Skip to content

Is there a way to include comments in a config file? #1104

Answered by sagikazarmark
DiscoRiver asked this question in Q&A
Discussion options

You must be logged in to vote

Viper does not and cannot support this feature sadly. Since Viper is an abstraction above several configuration sources, supporting comments in a generic way would require abstracting them as well which would be a lot of work with no real benefit.

I'd like to also add that WriteConfig is not intended for "updating" config files. That feature was added as a sort of "dump" that can be used for debugging or creating a default config file.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@DiscoRiver
Comment options

@sagikazarmark
Comment options

@DiscoRiver
Comment options

Answer selected by sagikazarmark
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants