From c6ee9808ab8547ad8021467022fbc955d750a7ea 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 7b12b36e9..5226090cd 100644 --- a/viper.go +++ b/viper.go @@ -1621,7 +1621,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) }