You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
but I want to rewrite this value using env variable: BLOCKED_COUNTRIES, and by the idea I should specify a json there, like {"eu":["DE","DK"]}, but it won't work, the blocked_countries won't be presented in viper.AllSettings(). I can affect the value only partially by using e.g. export BLOCKED_COUNTRIES_EU=DE,DK.
There is an option (#641) to specify DecodeHook, but only for unmarshaling. But on the step when I want to unmarshal what viper has into a struct, viper already does not have blocked_countries key using AllSettings(), though I can access a raw value of it using viper.Get("blocked_countries").
So my request is to add DecodeHooks also to "unmarshaling" env variables.
The text was updated successfully, but these errors were encountered:
Moved here from #772, commented by @stepanselyuk:
I don't know how to formulate a behavior, but an example:
when I use a config file (e.g. YAML) with a key:
it reads that as:
but I want to rewrite this value using env variable:
BLOCKED_COUNTRIES
, and by the idea I should specify a json there, like{"eu":["DE","DK"]}
, but it won't work, theblocked_countries
won't be presented inviper.AllSettings()
. I can affect the value only partially by using e.g.export BLOCKED_COUNTRIES_EU=DE,DK
.There is an option (#641) to specify DecodeHook, but only for unmarshaling. But on the step when I want to unmarshal what viper has into a struct, viper already does not have
blocked_countries
key usingAllSettings()
, though I can access a raw value of it usingviper.Get("blocked_countries")
.So my request is to add DecodeHooks also to "unmarshaling" env variables.
The text was updated successfully, but these errors were encountered: