This commit is contained in:
Thulio Ferraz Assis 2024-05-12 00:22:34 +02:00 committed by GitHub
commit af94b95ab9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1793,7 +1793,9 @@ func (v *Viper) writeConfig(filename string, force bool) error {
func (v *Viper) unmarshalReader(in io.Reader, c map[string]any) error {
buf := new(bytes.Buffer)
buf.ReadFrom(in)
if _, err := buf.ReadFrom(in); err != nil {
return ConfigParseError{err}
}
switch format := strings.ToLower(v.getConfigType()); format {
case "yaml", "yml", "json", "toml", "hcl", "tfvars", "ini", "properties", "props", "prop", "dotenv", "env":