fixed searchInPath matching file without extension

This commit is contained in:
rishavchaudharyi 2025-03-01 20:34:00 +05:30
parent 9c07e0f063
commit 947677093a

View file

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