1
0
mirror of https://github.com/json-iterator/go.git synced 2025-06-15 22:50:24 +02:00

fix unsafe reference

This commit is contained in:
Tao Wen
2016-12-11 18:19:26 +08:00
parent f154c8a934
commit c352559e52
2 changed files with 3 additions and 2 deletions

View File

@ -10,6 +10,7 @@ func Test_read_map(t *testing.T) {
iter := ParseString(`{"hello": "world"}`)
m := map[string]string{"1": "2"}
iter.Read(&m)
copy(iter.buf, []byte{0,0,0,0,0,0})
if !reflect.DeepEqual(map[string]string{"1": "2", "hello": "world"}, m) {
fmt.Println(iter.Error)
t.Fatal(m)