Merge pull request #798 from phil-park/master
fix: Fix backward compatibility of environment variables with bool type
This commit is contained in:
commit
e0016481f7
2
main.go
2
main.go
|
|
@ -131,7 +131,7 @@ func envBoolOrError(def bool, key string, alts ...string) (bool, error) {
|
|||
return parse(val)
|
||||
}
|
||||
for _, alt := range alts {
|
||||
if val := os.Getenv(key); val != "" {
|
||||
if val := os.Getenv(alt); val != "" {
|
||||
fmt.Fprintf(os.Stderr, "env %s has been deprecated, use %s instead\n", alt, key)
|
||||
return parse(val)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue