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

support map

This commit is contained in:
Tao Wen
2016-12-11 00:38:07 +08:00
parent aa42ac95c0
commit e427475e9c
2 changed files with 49 additions and 0 deletions

17
jsoniter_map_test.go Normal file
View File

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