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
4
viper.go
4
viper.go
|
@ -1976,9 +1976,11 @@ func (v *Viper) searchInPath(in string) (filename string) {
|
|||
}
|
||||
}
|
||||
|
||||
if b, _ := exists(v.fs, filepath.Join(in, v.configName)); b && v.configType != "" {
|
||||
if v.configType != "" {
|
||||
if b, _ := exists(v.fs, filepath.Join(in, v.configName)); b {
|
||||
return filepath.Join(in, v.configName)
|
||||
}
|
||||
}
|
||||
|
||||
return ""
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue