mirror of
https://github.com/spf13/viper
synced 2025-07-12 20:57:18 +00:00
First check for config type then for file without extension
This commit is contained in:
parent
40548756fc
commit
0dc4bb19c6
1 changed files with 4 additions and 2 deletions
6
viper.go
6
viper.go
|
@ -1976,8 +1976,10 @@ func (v *Viper) searchInPath(in string) (filename string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if b, _ := exists(v.fs, filepath.Join(in, v.configName)); b && v.configType != "" {
|
if v.configType != "" {
|
||||||
return filepath.Join(in, v.configName)
|
if b, _ := exists(v.fs, filepath.Join(in, v.configName)); b {
|
||||||
|
return filepath.Join(in, v.configName)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ""
|
return ""
|
||||||
|
|
Loading…
Add table
Reference in a new issue