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:
Quentin McGaw
2023-06-05 16:25:52 +00:00
parent 07459ee854
commit a9cd7be3f9
23 changed files with 188 additions and 491 deletions

View File

@@ -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)
}