How to watch config and overrides flags and env ? #1729
Unanswered
violin0622
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
-
When viper
v.WatchConfig()
and get file change notified, it only overrides config items that have not been set or set by earlier config file, and leaving items set by env var or flags unchanged.But in practice, people tend to modify config file, expecting all the items modified will take effect. After all, flags and env var can't be modified once the program stared. So, maybe it is more intuitive to let the modified config file takes higher prior than env var and flags ?
For the time being, how can I achieve the goal that make config items from a modified config file override env var and flags ?
Beta Was this translation helpful? Give feedback.
All reactions