Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interface types generate associated functions. Maybe they shouldn't. #379

Open
antdjohns opened this issue Nov 7, 2022 · 0 comments
Open

Comments

@antdjohns
Copy link

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{}.

@antdjohns 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant