1
0
mirror of https://github.com/json-iterator/go.git synced 2025-06-12 22:47:42 +02:00

suport encode map[interface{}]interface{}

This commit is contained in:
Tao Wen
2018-03-15 21:28:16 +08:00
parent 39acec93e0
commit ca39e5af3e
8 changed files with 46 additions and 15 deletions

View File

@ -31,3 +31,14 @@ func Test_read_map_with_reader(t *testing.T) {
should.Equal(m2, m1)
should.Equal("1.0.76", m1["note"].(map[string]interface{})["CoreServices"].(map[string]interface{})["version_name"])
}
func Test_map_eface_of_eface(t *testing.T) {
should := require.New(t)
json := jsoniter.ConfigCompatibleWithStandardLibrary
output, err := json.MarshalToString(map[interface{}]interface{}{
"1": 2,
3: "4",
})
should.NoError(err)
should.Equal(`{"1":2,"3":"4"}`, output)
}