mirror of
https://github.com/spf13/viper
synced 2024-12-22 11:37:02 +00:00
fix: config file search error
This commit is contained in:
parent
3924934ea9
commit
85ce03af09
1 changed files with 3 additions and 2 deletions
5
file.go
5
file.go
|
@ -27,8 +27,9 @@ func (v *Viper) findConfigFile() (string, error) {
|
|||
func (v *Viper) searchInPath(in string) (filename string) {
|
||||
v.logger.Debug("searching for config in path", "path", in)
|
||||
if v.configType != "" {
|
||||
if b, _ := exists(v.fs, filepath.Join(in, v.configName)); b {
|
||||
return filepath.Join(in, v.configName)
|
||||
if b, _ := exists(v.fs, filepath.Join(in, v.configName+"."+v.configType)); b {
|
||||
v.logger.Debug("found file", "file", filepath.Join(in, v.configName+"."+v.configType))
|
||||
return filepath.Join(in, v.configName+"."+v.configType)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue