mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-23 12:31:07 +01:00
lib/envflag: use flag.Set for setting the flags from env vars
This should make visible the set flags at flag.Visit(), which is used later for logging and exporting the `is_set` label for these flags at /metrics page
This commit is contained in:
parent
53bb58ed2a
commit
676ad70d9f
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user