From 220da9f354f7d89b2c3447290c3de4809dcaaf78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kobus?= Date: Tue, 12 Jul 2022 16:09:52 +0200 Subject: [PATCH] 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. --- viper_go1_15.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/viper_go1_15.go b/viper_go1_15.go index 19a771cbd..caa163e29 100644 --- a/viper_go1_15.go +++ b/viper_go1_15.go @@ -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) }