diff --git a/lib/envflag/envflag.go b/lib/envflag/envflag.go index 3d4014dee..e4cb5b2e2 100644 --- a/lib/envflag/envflag.go +++ b/lib/envflag/envflag.go @@ -40,7 +40,7 @@ func Parse() { // Get flag value from environment var. fname := getEnvFlagName(f.Name) if v, ok := os.LookupEnv(fname); ok { - if err := f.Value.Set(v); err != nil { + if err := flag.Set(f.Name, v); err != nil { // Do not use lib/logger here, since it is uninitialized yet. log.Fatalf("cannot set flag %s to %q, which is read from environment variable %q: %s", f.Name, v, fname, err) }