Commit c2a53b1b authored by tengufromsky's avatar tengufromsky Committed by Brad Fitzpatrick

encoding/json: remove unnecessary if conditions

Fixes gosimple warning "if err != nil { return err };
return nil' can be simplified to 'return err"

Change-Id: Ife7f78a3a76ab7802b5561d1afec536e103b504a
Reviewed-on: https://go-review.googlesource.com/108275Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 9f10d283
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment