chore(env): getEnvWithRetro helper function
This commit is contained in:
10
internal/configuration/sources/env/publicip.go
vendored
10
internal/configuration/sources/env/publicip.go
vendored
@@ -35,17 +35,9 @@ func readPublicIPPeriod() (period *time.Duration, err error) {
|
||||
}
|
||||
|
||||
func (r *Reader) readPublicIPFilepath() (filepath *string) {
|
||||
// Retro-compatibility
|
||||
s := os.Getenv("IP_STATUS_FILE")
|
||||
if s != "" {
|
||||
r.onRetroActive("IP_STATUS_FILE", "PUBLICIP_FILE")
|
||||
return &s
|
||||
}
|
||||
|
||||
s = os.Getenv("PUBLICIP_FILE")
|
||||
_, s := r.getEnvWithRetro("PUBLICIP_FILE", "IP_STATUS_FILE")
|
||||
if s != "" {
|
||||
return &s
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user