SetDefaults and nested config #1559
Unanswered
mieliespoor
asked this question in
Q&A
Replies: 1 comment 1 reply
-
|
Did you ever figure out how to achieve this? Running into the exact same issue with an |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm not sure I correctly understand how to set defaults for a nested config.
Take this:
I have tried
viper.SetDefault("EnabledMetrics.projectInfo", true)and also:Neither of the two work, and when I Unmarshal the config, everything under EnabledMetrics is false. Where do I go wrong?
Beta Was this translation helpful? Give feedback.
All reactions