Fix file search for empty config type

When config type is unset and filename provided with extension viper failed to properly find that file. 
According to the docs, having set file name with extension is not required to provide config type.
This commit is contained in:
Radosław Kobus 2022-07-12 16:09:52 +02:00 committed by GitHub
parent 98c63ede11
commit 220da9f354
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -35,7 +35,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)
}