`omitempty` unexpectedly omits a member when the member is a struct with a non-zero unexported member
Issue tracker is used for reporting bugs and discussing new features. Please use Discord or stackoverflow for supporting issues.
Here is the minimum test case: https://go.dev/play/p/3FvUksIAooa
Expected Behavior
Nothing is printed
Current Behavior
got: "", want: "str"
Possible Solution
omitempty should not ignore a struct value which is with a non-zero unexported member. This should be possible by comparing with a zero value.
Steps to Reproduce
Context (Environment)
Detailed Description
Possible Implementation
Opened #387 for this.
Hi @hajimehoshi, this repo has been unmaintained for ~3 years so this issue is unlikely to get addressed here.
We're maintaining a community fork at github.com/Basekick-Labs/msgpack (v6) as a drop-in replacement. The omitempty behavior around structs with non-zero unexported members is something we can prioritize in the fork — would you be interested in filing the issue there or contributing a fix? Happy to review PRs.