From 947677093a1ad02a7e91dcc95fc0bff5b722df75 Mon Sep 17 00:00:00 2001 From: rishavchaudharyi Date: Sat, 1 Mar 2025 20:34:00 +0530 Subject: [PATCH] fixed searchInPath matching file without extension --- file.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/file.go b/file.go index 50a4058..bcab3ac 100644 --- a/file.go +++ b/file.go @@ -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) } }