1
0
mirror of https://github.com/json-iterator/go.git synced 2025-06-24 23:16:47 +02:00

#56 nil map or array should be null not [] or {}

This commit is contained in:
Tao Wen
2017-06-13 09:14:19 +08:00
parent 6e5817b773
commit 788918b85d
6 changed files with 64 additions and 6 deletions

View File

@ -228,7 +228,7 @@ func Test_write_array(t *testing.T) {
func Test_write_val_array(t *testing.T) {
should := require.New(t)
val := []int{1, 2, 3}
str, err := MarshalToString(val)
str, err := MarshalToString(&val)
should.Nil(err)
should.Equal("[1,2,3]", str)
}