You've already forked json-iterator
mirror of
https://github.com/json-iterator/go.git
synced 2025-06-15 22:50:24 +02:00
write map with int key
This commit is contained in:
@ -66,4 +66,12 @@ func Test_slice_of_map(t *testing.T) {
|
||||
val = []map[string]string{}
|
||||
should.Nil(UnmarshalFromString(str, &val))
|
||||
should.Equal("2", val[0]["1"])
|
||||
}
|
||||
|
||||
func Test_write_int_key_map(t *testing.T) {
|
||||
should := require.New(t)
|
||||
val := map[int]string{1: "2"}
|
||||
str, err := MarshalToString(val)
|
||||
should.Nil(err)
|
||||
should.Equal(`{"1":"2"}`, str)
|
||||
}
|
Reference in New Issue
Block a user