mirror of
https://github.com/spf13/viper
synced 2024-11-16 18:07:02 +00:00
Fixed unmarshalReader not returning error when the input io.Reader returns an error
This commit is contained in:
parent
62edee3196
commit
8f88ea76a6
1 changed files with 3 additions and 1 deletions
4
viper.go
4
viper.go
|
@ -1329,7 +1329,9 @@ func unmarshalReader(in io.Reader, c map[string]interface{}) error {
|
|||
}
|
||||
func (v *Viper) unmarshalReader(in io.Reader, c map[string]interface{}) error {
|
||||
buf := new(bytes.Buffer)
|
||||
buf.ReadFrom(in)
|
||||
if _, err := buf.ReadFrom(in); err != nil {
|
||||
return ConfigParseError{err}
|
||||
}
|
||||
|
||||
switch strings.ToLower(v.getConfigType()) {
|
||||
case "yaml", "yml":
|
||||
|
|
Loading…
Reference in a new issue