chore(env): getEnvWithRetro helper function

This commit is contained in:
Quentin McGaw
2022-01-29 14:55:56 +00:00
parent e7e4cfca4c
commit 0d8cb66d43
13 changed files with 113 additions and 300 deletions

View File

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