@@ -970,6 +970,7 @@ func TestEncoder_encodeStruct(t *testing.T) {
970970 Name string `json:"name"`
971971 Age int64 `json:"age,omitempty"`
972972 Email * string `json:"email,omitempty"`
973+ Email2 * string `json:"email2"`
973974 Address Address `json:"address"`
974975 Tags []string `json:"tags,omitempty"`
975976 Nickname string `json:"nickname,omitempty"`
@@ -1002,6 +1003,7 @@ func TestEncoder_encodeStruct(t *testing.T) {
10021003 "name" : "John" ,
10031004 "age" : int64 (30 ),
10041005 "email" : "test@example.com" ,
1006+ "email2" : nil ,
10051007 "address" : map [string ]any {"city" : "Tokyo" , "country" : "Japan" , "zip" : "123-4567" },
10061008 "tags" : []any {"tag1" , "tag2" },
10071009 "nickname" : "Johnny" ,
@@ -1016,6 +1018,7 @@ func TestEncoder_encodeStruct(t *testing.T) {
10161018 enableOmitemptyTag : true ,
10171019 want : map [string ]any {
10181020 "name" : "John" ,
1021+ "email2" : nil ,
10191022 "address" : map [string ]any {"city" : "Tokyo" },
10201023 },
10211024 },
@@ -1030,6 +1033,7 @@ func TestEncoder_encodeStruct(t *testing.T) {
10301033 "name" : "John" ,
10311034 "age" : int64 (0 ),
10321035 "email" : nil ,
1036+ "email2" : nil ,
10331037 "address" : map [string ]any {"city" : "Tokyo" , "country" : "" , "zip" : nil },
10341038 "tags" : []any {},
10351039 "nickname" : "" ,
0 commit comments