mirror of
https://github.com/spf13/viper
synced 2024-12-23 03:57:01 +00:00
Current working directory is added to the config search paths by default
This commit is contained in:
parent
ac722f39d3
commit
3f5458e0d3
1 changed files with 7 additions and 0 deletions
7
viper.go
7
viper.go
|
@ -100,6 +100,13 @@ func New() *Viper {
|
||||||
v.env = make(map[string]string)
|
v.env = make(map[string]string)
|
||||||
v.aliases = 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
|
return v
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue