First check for config type then for file without extension

This commit is contained in:
Pedro Silva 2020-01-12 11:41:09 +00:00
parent 40548756fc
commit 0dc4bb19c6
No known key found for this signature in database
GPG key ID: 135E84A1E585EE34

View file

@ -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 filepath.Join(in, v.configName)
} }
}
return "" return ""
} }