Merge pull request #342 from denis96z/master

Fix too many arguments in call to MarshalJSON
This commit is contained in:
Dmitry Rybakov
2021-09-12 22:13:39 +03:00
committed by GitHub
+1 -1
View File
@@ -269,7 +269,7 @@ func (g *Generator) genTypeEncoderNoCheck(t reflect.Type, in string, tags fieldT
fmt.Fprintln(g.out, ws+"if m, ok := "+in+".(easyjson.Marshaler); ok {")
fmt.Fprintln(g.out, ws+" m.MarshalEasyJSON(out)")
fmt.Fprintln(g.out, ws+"} else {")
fmt.Fprintln(g.out, ws+in+".MarshalJSON(out)")
fmt.Fprintln(g.out, ws+in+".MarshalJSON()")
fmt.Fprintln(g.out, ws+"}")
} else {
return fmt.Errorf("interface type %v not supported: only interface{} and interfaces that implement json or easyjson Marshaling are allowed", t)