From abc5f3d68027fd01bedcbe161e78feac1db2322f Mon Sep 17 00:00:00 2001 From: Kush <3647166+kushsharma@users.noreply.github.com> Date: Fri, 4 Dec 2020 00:37:38 +0530 Subject: [PATCH] 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. --- viper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/viper.go b/viper.go index 7027715..8a8d3b5 100644 --- a/viper.go +++ b/viper.go @@ -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) }