fix: Fix backward compatibility of environment variables with bool type

Signed-off-by: Jiwon Park <bakjeeone@hotmail.com>
This commit is contained in:
Jiwon Park 2023-08-31 07:39:54 +09:00
parent 5e5035d029
commit 8bb3467a24
1 changed files with 1 additions and 1 deletions

View File

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