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
1 changed files with 1 additions and 1 deletions

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)
}