File tree Expand file tree Collapse file tree 1 file changed +29
-1
lines changed
Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -1578,7 +1578,6 @@ func TestGithubIssue41(t *testing.T) {
15781578 "expected: " , expectedString ,
15791579 )
15801580 }
1581-
15821581}
15831582
15841583func TestGithubIssue44 (t * testing.T ) {
@@ -1602,6 +1601,35 @@ func (r *rawJsonString) UnmarshalJSON(b []byte) error {
16021601 return nil
16031602}
16041603
1604+ func TestGithubIssue63 (t * testing.T ) {
1605+ expectedString := `{"my_field":"test","code":0}`
1606+
1607+ type MyStruct struct {
1608+ MyField string `json:"my_field,omitempty"`
1609+ }
1610+
1611+ type MyStruct2 struct {
1612+ * MyStruct
1613+ Code int `json:"code"`
1614+ }
1615+
1616+ input := MyStruct2 {
1617+ MyStruct : & MyStruct {
1618+ MyField : "test" ,
1619+ },
1620+ Code : 0 ,
1621+ }
1622+
1623+ if b , err := Marshal (input ); err != nil {
1624+ t .Error (err )
1625+ } else if string (b ) != expectedString {
1626+ t .Error (
1627+ "got: " , string (b ),
1628+ "expected: " , expectedString ,
1629+ )
1630+ }
1631+ }
1632+
16051633func TestSetTrustRawMessage (t * testing.T ) {
16061634 buf := & bytes.Buffer {}
16071635 enc := NewEncoder (buf )
You can’t perform that action at this time.
0 commit comments