|
|
9 年之前 | |
|---|---|---|
| LICENSE | 9 年之前 | |
| README.md | 9 年之前 | |
| any.go | 9 年之前 | |
| any_test.go | 9 年之前 | |
| jsoniter.go | 9 年之前 | |
| jsoniter_adapter.go | 9 年之前 | |
| jsoniter_any_test.go | 9 年之前 | |
| jsoniter_array_test.go | 9 年之前 | |
| jsoniter_base64_test.go | 9 年之前 | |
| jsoniter_bool_test.go | 9 年之前 | |
| jsoniter_customize_test.go | 9 年之前 | |
| jsoniter_demo_test.go | 9 年之前 | |
| jsoniter_find_end_test.go | 9 年之前 | |
| jsoniter_float_test.go | 9 年之前 | |
| jsoniter_int_test.go | 9 年之前 | |
| jsoniter_io_test.go | 9 年之前 | |
| jsoniter_large_file_test.go | 9 年之前 | |
| jsoniter_map_test.go | 9 年之前 | |
| jsoniter_nested_test.go | 9 年之前 | |
| jsoniter_null_test.go | 9 年之前 | |
| jsoniter_object_test.go | 9 年之前 | |
| jsoniter_reflect.go | 9 年之前 | |
| jsoniter_reflect_test.go | 9 年之前 | |
| jsoniter_skip_test.go | 9 年之前 | |
| jsoniter_string_test.go | 9 年之前 |
jsoniter (json-iterator) is fast and flexible JSON parser available in Java and Go
Given this JSON document [0,1,2,3]
Parse with Go bind-api
import "github.com/json-iterator/go"
iter := jsoniter.ParseString(`[0,1,2,3]`)
val := []int{}
iter.Read(&val)
fmt.Println(val[3])
Parse with Go any-api
import "github.com/json-iterator/go"
iter := jsoniter.ParseString(`[0,1,2,3]`)
val := iter.ReadAny()
fmt.Println(val.Get(3))
Parse with Go iterator-api
import "github.com/json-iterator/go"
iter := ParseString(`[0,1,2,3]`)
total := 0
for iter.ReadArray() {
total += iter.ReadInt()
}
fmt.Println(total)
go get github.com/json-iterator/go