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
In the above code, since the Cfg is nested in the map, how do I set default values for the fields in the Cfg?
Because the key of the map is uncertain, so it can't be set by viper.SetDefault.
Currently, the default value is the default value of each data type. DecodeHook doesn't seem to be able to do it, I just need to handle the default values, the rest of the data parsing and binding is still done by viper.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In the above code, since the Cfg is nested in the map, how do I set default values for the fields in the Cfg?
Because the key of the map is uncertain, so it can't be set by
viper.SetDefault
.Currently, the default value is the default value of each data type.
DecodeHook
doesn't seem to be able to do it, I just need to handle the default values, the rest of the data parsing and binding is still done by viper.Beta Was this translation helpful? Give feedback.
All reactions