Skip to content

Conversation

@GCrispino
Copy link

Fixes #488.

To do this I set fieldCode.isNilCheck to true in the case statement where isPtr && c.isPtrMarshalJSONType(fieldType): in Compiler's method structFieldCode.
To be honest I don't exactly know all the implications to this, but this didn't break any tests and made the new test I added for the issue pass, so maybe this is a valid fix.

Gabriel Crispino added 2 commits December 17, 2023 21:26
test: draft for omitempty on pointer receiver for MarshalJSON

test: move new test onto omitempty marshaling tests
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.

omitempty tag is ignored when field's type has pointer receiver in MarshalJSON implementation

1 participant