Viper is deleting all comments when viper.Set and viper.WriteConfig is done #1173
-
Viper is deleting in my example all comments when viper.Set and viper.WriteConfig is done. I read in the values of a config file (yaml type) and change the value of one of the Parameters. config.yml before write:
config.yml after viper.Set and viper.WriteConfig: comments lost, empty lines and other order
expected behaviour:
Is there any possibility to keep the file as it has been before and just change the Values? Thanks and best regards, Alex |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Unfortunately, no. It would be quite hard to implement with very minimal benefit. WriteConfig is not supposed to be used for updating config files. It's more like a tool to dump default configuration. |
Beta Was this translation helpful? Give feedback.
Unfortunately, no. It would be quite hard to implement with very minimal benefit.
WriteConfig is not supposed to be used for updating config files. It's more like a tool to dump default configuration.