From 1845bb70a0e83a5812f03928bbb7c851c163fdd8 Mon Sep 17 00:00:00 2001 From: Will Storey Date: Sun, 28 May 2017 12:45:22 -0700 Subject: [PATCH] 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. --- gen/decoder.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gen/decoder.go b/gen/decoder.go index 80f8d2c..2fece5d 100644 --- a/gen/decoder.go +++ b/gen/decoder.go @@ -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+"}")