mirror of https://github.com/spf13/viper.git
Fixed unmarshalReader not returning error when the input io.Reader returns an error
This commit is contained in:
parent
62edee3196
commit
8f88ea76a6
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 New Issue