Replies: 1 comment
-
Well, defining global variables is a bad practice, avoid it at all cost. If you can't, consider the order when your values are set in Viper: by calling Your example doesn't contain information from which config source you are trying to load config from (flags, file, env var, etc). Make sure to get values from Viper after it's been initialized. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
when define the globa variable with viper outside the func , it doesnot work.
How to solve the situation?
Beta Was this translation helpful? Give feedback.
All reactions