1
0
mirror of https://github.com/json-iterator/go.git synced 2025-06-18 22:57:33 +02:00

Formated, doced. Also fixed few minor bugs.

This commit is contained in:
SuperFashi
2017-01-05 21:23:08 +08:00
parent 97849e019f
commit d63a00f0bf
24 changed files with 438 additions and 402 deletions

@ -1,9 +1,9 @@
package jsoniter
import (
"testing"
"reflect"
"encoding/json"
"reflect"
"testing"
)
type Level1 struct {
@ -28,14 +28,14 @@ func Test_nested(t *testing.T) {
case "world":
l2.World = iter.ReadString()
default:
iter.ReportError("bind l2", "unexpected field: " + l2Field)
iter.reportError("bind l2", "unexpected field: "+l2Field)
}
}
l2Array = append(l2Array, l2)
}
l1.Hello = l2Array
default:
iter.ReportError("bind l1", "unexpected field: " + l1Field)
iter.reportError("bind l1", "unexpected field: "+l1Field)
}
}
if !reflect.DeepEqual(l1, Level1{
@ -85,4 +85,4 @@ func Benchmark_json_nested(b *testing.B) {
l1 := Level1{}
json.Unmarshal([]byte(`{"hello": [{"world": "value1"}, {"world": "value2"}]}`), &l1)
}
}
}