You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are looking to handle polymorphic responses and for that we are using an Interface "IEvent" as a marker for this type. When easyjson generates unmarshaling and marshaling code for this type it uses the interface opposed to the structs that fit the interface type. This results in nil pointer panics when unmarshal is called on the interface.
To work around I simply removed the []IEvent type and replaced with []interface{}.
The text was updated successfully, but these errors were encountered:
antdjohns
changed the title
Interface types generate unmarshal functions. Maybe they shouldn't.
Interface types generate associated functions. Maybe they shouldn't.
Nov 7, 2022
We are looking to handle polymorphic responses and for that we are using an Interface "IEvent" as a marker for this type. When easyjson generates unmarshaling and marshaling code for this type it uses the interface opposed to the structs that fit the interface type. This results in nil pointer panics when unmarshal is called on the interface.
To work around I simply removed the []IEvent type and replaced with []interface{}.
The text was updated successfully, but these errors were encountered: