Merge pull request #119 from horgh/master

Explicitly ignore error from UnmarshalJSON()
This commit is contained in:
Vasily Romanov
2017-06-22 11:20:19 +03:00
committed by GitHub
+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+"}")