Explicitly ignore error from UnmarshalJSON()

This function can return an error which we currently ignore. Be explicit
about this. Primarily this is so linters will not complain.
This commit is contained in:
Will Storey
2017-06-10 10:55:29 -07:00
parent 44c0351a5b
commit 1845bb70a0
+1 -1
View File
@@ -228,7 +228,7 @@ func (g *Generator) genTypeDecoderNoCheck(t reflect.Type, out string, tags field
fmt.Fprintln(g.out, ws+"if m, ok := "+out+".(easyjson.Unmarshaler); ok {")
fmt.Fprintln(g.out, ws+"m.UnmarshalEasyJSON(in)")
fmt.Fprintln(g.out, ws+"} else if m, ok := "+out+".(json.Unmarshaler); ok {")
fmt.Fprintln(g.out, ws+"m.UnmarshalJSON(in.Raw())")
fmt.Fprintln(g.out, ws+"_ = m.UnmarshalJSON(in.Raw())")
fmt.Fprintln(g.out, ws+"} else {")
fmt.Fprintln(g.out, ws+" "+out+" = in.Interface()")
fmt.Fprintln(g.out, ws+"}")