Skip to content

can we use it as global config? #1980

Answered by tahadostifam
kehiy asked this question in Q&A
Discussion options

You must be logged in to vote

As i remember viper has some features to watch the config files so you can update your cfg within runtime using by this.

But actually you need to be careful that how you deliver the new updates to your services to prevent inconsistency.

Check this out:

viper.WatchConfig()

viper.OnConfigChange(func(_ fsnotify.Event) {
   loadConfig()
})

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kehiy
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