mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-05 01:01:09 +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
93511b4be7
commit
a105b71116
@ -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