How to avoid writing unnecessary objects into TOML with WriteConfig #1597
Unanswered
fmuyassarov
asked this question in
Q&A
Replies: 0 comments
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 using Viper to read, modify and then write TOML configuration. The issue I have is how Viper handles the configuration structure when writing to TOML file.
My initial config.toml looks like this:
and I would like to modify it to be like this
The go code I'm using:
However, when Viper writes into the config.toml I'm getting unnecessary entry names of all the nested fields.
Is there a way to avoid those extra objects ?
Beta Was this translation helpful? Give feedback.
All reactions