-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Defaults to current dir #69
Comments
I second this bug. As I mentioned in #55 (comment) this bug is a source of failures and confusion. To answer the comment from @kzvezdarov in #55 (comment) I have to note, that many programs which read config do not use command-line parameters (CLP) to override all, especially sensitive, aspects of configuration. And that is often a good thing operationally. I am glad that viper does not require to match all config entries with CLPs - and that CLPs are not part of the viper package. |
@kzvezdarov The current behavior is no-no; I have started to write small CLI Go apps for many tasks now, and I scratched my head a few times until I understood what happened. If someone wants to add |
@kzvezdarov great, thank you! Looking forward to pull it. |
Merged. |
Not sure if that belongs to this or new bug - viper still defaults to current dir if no directories specified or all specified directories do not exist. The former case is not of huge concern. The latter (non-existing directories) is. |
@didenko Apparently we have this: https://github.com/spf13/viper/blob/master/viper.go#L970 |
Yea, well - that one I an live with, as I always set a config path. It's definitively another issue (a related one). |
OK, posted #73 for the follow-up issue. Thank you for clarifications. |
Viper defaults to loading config.toml (if that is the config name set) from the current directory.
This is very confusing if you have several applications using Viper, and your command prompt happen to be in "the other one".
The text was updated successfully, but these errors were encountered: