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

Fix handling of anon structs with embedded structs and fields #339

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

autarch
Copy link

@autarch autarch commented May 10, 2021

No description provided.

If the anon struct embeds another struct _and_ contains fields of its own,
there were cases where the generated code would ignore the anon struct's own
fields.

This happened because when checking if the anon struct implements a marshaling
interface, the reflect package returns true if the anon struct's _embedded
struct_ implements that interface. But using that interface means that the
other fields in the anon struct are ignored.
@autarch autarch force-pushed the autarch/embedded-field-and-sibling-fix branch from b7d8b50 to 6ea728d Compare May 10, 2021 18:38
@autarch autarch marked this pull request as ready for review May 10, 2021 18:42
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

Successfully merging this pull request may close these issues.

None yet

1 participant