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 b7136cc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions encode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2710,3 +2710,17 @@ func TestIssue441(t *testing.T) {
assertErr(t, err)
assertEq(t, "unexpected result", "{}", string(b))
}

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

type B struct {
A
}

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

0 comments on commit b7136cc

Please sign in to comment.