fix INI saving panics

This commit is contained in:
r-stepanenko 2021-02-11 08:57:13 +03:00 committed by GitHub
parent d10c856f6c
commit 535b784f8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1743,7 +1743,7 @@ func (v *Viper) marshalWriter(f afero.File, configType string) error {
if sectionName == "default" {
sectionName = ""
}
cfg.Section(sectionName).Key(keyName).SetValue(v.Get(key).(string))
cfg.Section(sectionName).Key(keyName).SetValue(v.GetString(key))
}
cfg.WriteTo(f)
}