File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,13 @@ func TestJSONRoundTrip(t *testing.T) {
6565 `{"$vocabulary":{"b":true, "a":false}}` ,
6666 `{"$vocabulary":{"a":false,"b":true}}` ,
6767 },
68- {`{"unk":0}` , `{"unk":0}` }, // unknown fields are not dropped
68+ {`{"unk":0}` , `{"unk":0}` }, // unknown fields are not dropped
69+ {
70+ // known and unknown fields are not dropped
71+ // note that the order will be by the declaration order in the anonymous struct inside MarshalJSON
72+ `{"comment":"test","type":"example","unk":0}` ,
73+ `{"type":"example","comment":"test","unk":0}` ,
74+ },
6975 {`{"extra":0}` , `{"extra":0}` }, // extra is not a special keyword and should not be dropped
7076 {`{"Extra":0}` , `{"Extra":0}` }, // Extra is not a special keyword and should not be dropped
7177 } {
You can’t perform that action at this time.
0 commit comments