Fixed unmarshalReader not returning error when the input io.Reader returns an error

This commit is contained in:
Thulio Assis 2018-10-19 13:47:18 -07:00
parent 62edee3196
commit 8f88ea76a6
No known key found for this signature in database
GPG key ID: 7484A94EF9712178

View file

@ -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":