Current working directory is added to the config search paths by default

This commit is contained in:
Kiril Zvezdarov 2015-03-28 13:36:55 -04:00
parent c861bdefb7
commit 40762f7541

View file

@ -143,6 +143,13 @@ func New() *Viper {
v.env = make(map[string]string)
v.aliases = make(map[string]string)
wd, err := os.Getwd()
if err != nil {
jww.INFO.Println("Could not add cwd to search paths", err)
} else {
v.AddConfigPath(wd)
}
return v
}