fix: Fix backward compatibility of environment variables with bool type
Signed-off-by: Jiwon Park <bakjeeone@hotmail.com>
This commit is contained in:
parent
5e5035d029
commit
8bb3467a24
2
main.go
2
main.go
|
|
@ -131,7 +131,7 @@ func envBoolOrError(def bool, key string, alts ...string) (bool, error) {
|
||||||
return parse(val)
|
return parse(val)
|
||||||
}
|
}
|
||||||
for _, alt := range alts {
|
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)
|
fmt.Fprintf(os.Stderr, "env %s has been deprecated, use %s instead\n", alt, key)
|
||||||
return parse(val)
|
return parse(val)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue