aboutsummaryrefslogtreecommitdiff
path: root/src/encoding
diff options
context:
space:
mode:
Diffstat (limited to 'src/encoding')
-rw-r--r--src/encoding/json/decode.go12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/encoding/json/decode.go b/src/encoding/json/decode.go
index 9479e1a5c6..6a66940034 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