Update viper.go

This commit is contained in:
zhangyongding 2020-06-02 10:41:27 +08:00 committed by GitHub
parent 2bf315e378
commit 6999737484
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)
}