viper.searchInPath matching files with no ext

I think if the user is setting config type explicitly, we shouldn't be matching it with non-ext files but doing it when the extension is not provided.
This commit is contained in:
Kush 2020-12-04 00:37:38 +05:30 committed by GitHub
parent bba82cfc61
commit abc5f3d680
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2119,7 +2119,7 @@ func (v *Viper) searchInPath(in string) (filename string) {
}
}
if v.configType != "" {
if v.configType == "" {
if b, _ := exists(v.fs, filepath.Join(in, v.configName)); b {
return filepath.Join(in, v.configName)
}