Skip to content

fix(encode): respect non-zero unexported fields in omitempty check (#6)#43

Merged
xe-nvdk merged 1 commit intov6from
fix/omitempty-unexported-fields
Mar 2, 2026
Merged

fix(encode): respect non-zero unexported fields in omitempty check (#6)#43
xe-nvdk merged 1 commit intov6from
fix/omitempty-unexported-fields

Conversation

@xe-nvdk
Copy link
Copy Markdown
Member

@xe-nvdk xe-nvdk commented Mar 2, 2026

Summary

Test plan

  • New test TestOmitEmptyUnexportedFields validates structs with non-zero unexported fields are NOT omitted
  • Verifies structs with all-zero fields are still correctly omitted
  • Full test suite passes

The omitempty emptiness check only examined exported fields, causing
structs with non-zero unexported data to be incorrectly omitted.
@xe-nvdk xe-nvdk merged commit 91af8d8 into v6 Mar 2, 2026
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 incorrectly omits structs with non-zero unexported fields

1 participant