Skip to content

Commit

Permalink
chore: add unit test for #459
Browse files Browse the repository at this point in the history
  • Loading branch information
NgoKimPhu committed Nov 4, 2023
1 parent f13a706 commit 078b728
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions encode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2710,3 +2710,19 @@ func TestIssue441(t *testing.T) {
assertErr(t, err)
assertEq(t, "unexpected result", "{}", string(b))
}

func TestIssue459(t *testing.T) {
type A struct {
Z *struct {
A
} `json:"z,omitempty"`
}

type B struct {
A
}

b, err := json.Marshal(B{})
assertErr(t, err)
assertEq(t, "unexpected result", "{}", string(b))
}

0 comments on commit 078b728

Please sign in to comment.