From 4cdfe8f7756e61bd9800652bb004799eb24ea0db Mon Sep 17 00:00:00 2001 From: flow00 <368568335@qq.com> Date: Sun, 15 Mar 2020 17:55:27 +0800 Subject: [PATCH] fix_ini_save_error --- viper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/viper.go b/viper.go index 4bc6726ae..63d813299 100644 --- a/viper.go +++ b/viper.go @@ -1657,7 +1657,7 @@ func (v *Viper) marshalWriter(f afero.File, configType string) error { if sectionName == "default" { sectionName = "" } - cfg.Section(sectionName).Key(keyName).SetValue(Get(key).(string)) + cfg.Section(sectionName).Key(keyName).SetValue(v.Get(key).(string)) } cfg.WriteTo(f) }