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

#53 extract out config

This commit is contained in:
Tao Wen
2017-06-13 16:58:53 +08:00
parent 788918b85d
commit acddcf5bbf
33 changed files with 328 additions and 300 deletions

View File

@ -15,7 +15,7 @@ type Level2 struct {
}
func Test_nested(t *testing.T) {
iter := ParseString(`{"hello": [{"world": "value1"}, {"world": "value2"}]}`)
iter := ParseString(DEFAULT_CONFIG, `{"hello": [{"world": "value1"}, {"world": "value2"}]}`)
l1 := Level1{}
for l1Field := iter.ReadObject(); l1Field != ""; l1Field = iter.ReadObject() {
switch l1Field {
@ -50,7 +50,7 @@ func Test_nested(t *testing.T) {
func Benchmark_jsoniter_nested(b *testing.B) {
for n := 0; n < b.N; n++ {
iter := ParseString(`{"hello": [{"world": "value1"}, {"world": "value2"}]}`)
iter := ParseString(DEFAULT_CONFIG, `{"hello": [{"world": "value1"}, {"world": "value2"}]}`)
l1 := Level1{}
for l1Field := iter.ReadObject(); l1Field != ""; l1Field = iter.ReadObject() {
switch l1Field {