From b2d7017f54f11bd5c91ebbff357072e9a017971b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9ra=20Zolt=C3=A1n?= Date: Fri, 15 Jan 2021 15:07:56 +0200 Subject: [PATCH] fix write hidden file without extension (fix #1017) --- viper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/viper.go b/viper.go index 7027715095..05e5deb607 100644 --- a/viper.go +++ b/viper.go @@ -1537,7 +1537,7 @@ func (v *Viper) writeConfig(filename string, force bool) error { var configType string ext := filepath.Ext(filename) - if ext != "" { + if ext != "" && ext != filepath.Base(filename) { configType = ext[1:] } else { configType = v.configType