chore(sources/env): bump gosettings to v0.3.0-rc13
- Use `RetroKeys` option with env.* method calls - Use `CSV*` typed methods - Inject `handleDeprecatedKey` function
This commit is contained in:
19
internal/configuration/sources/env/server.go
vendored
19
internal/configuration/sources/env/server.go
vendored
@@ -16,17 +16,16 @@ func (s *Source) readControlServer() (controlServer settings.ControlServer, err
|
||||
}
|
||||
|
||||
func (s *Source) readControlServerAddress() (address *string) {
|
||||
key, value := s.getEnvWithRetro("HTTP_CONTROL_SERVER_ADDRESS",
|
||||
[]string{"CONTROL_SERVER_ADDRESS"})
|
||||
const currentKey = "HTTP_CONTROL_SERVER_ADDRESS"
|
||||
key := firstKeySet(s.env, "CONTROL_SERVER_ADDRESS", currentKey)
|
||||
if key == currentKey {
|
||||
return s.env.Get(key)
|
||||
}
|
||||
|
||||
s.handleDeprecatedKey(key, currentKey)
|
||||
value := s.env.Get("CONTROL_SERVER_ADDRESS")
|
||||
if value == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
if key == "HTTP_CONTROL_SERVER_ADDRESS" {
|
||||
return value
|
||||
}
|
||||
|
||||
address = new(string)
|
||||
*address = ":" + *value
|
||||
return address
|
||||
return ptrTo(":" + *value)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user