diff --git a/src/encoding/json/decode.go b/src/encoding/json/decode.go index 9479e1a5c66..6a669400346 100644 --- a/src/encoding/json/decode.go +++ b/src/encoding/json/decode.go @@ -868,11 +868,7 @@ func (d *decodeState) literalStore(item []byte, v reflect.Value, fromQuoted bool isNull := item[0] == 'n' // null u, ut, pv := indirect(v, isNull) if u != nil { - err := u.UnmarshalJSON(item) - if err != nil { - return err - } - return nil + return u.UnmarshalJSON(item) } if ut != nil { if item[0] != '"' { @@ -899,11 +895,7 @@ func (d *decodeState) literalStore(item []byte, v reflect.Value, fromQuoted bool } return errPhase } - err := ut.UnmarshalText(s) - if err != nil { - return err - } - return nil + return ut.UnmarshalText(s) } v = pv