From 6999737484b0426c0555a6ca3872f3365ec91cd3 Mon Sep 17 00:00:00 2001 From: zhangyongding <54876819+zhangyongding@users.noreply.github.com> Date: Tue, 2 Jun 2020 10:41:27 +0800 Subject: [PATCH] Update viper.go --- viper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/viper.go b/viper.go index ad8b658..fd279a4 100644 --- a/viper.go +++ b/viper.go @@ -1649,7 +1649,7 @@ func (v *Viper) marshalWriter(f afero.File, configType string) error { if sectionName == "default" { sectionName = "" } - cfg.Section(sectionName).Key(keyName).SetValue(cast.ToString(v.Get(key))) + cfg.Section(sectionName).Key(keyName).SetValue(v.GetString(key)) } cfg.WriteTo(f) }