説明なし

Tao Wen e7c7f3b337 fix coverage 7 年 前
any_tests 477be43d00 consolidate more tests 7 年 前
api_tests 8fa357ab7b consolidate mor tests 7 年 前
benchmarks e3bc511e5a consolidate more tests 7 年 前
extension_tests 8fa357ab7b consolidate mor tests 7 年 前
extra b134d86290 optimize code 8 年 前
misc_tests 477be43d00 consolidate more tests 7 年 前
skip_tests 477be43d00 consolidate more tests 7 年 前
type_tests 24bb2eee9f fix #236 case sensitive when both upper case and lower case presents 7 年 前
value_tests 477be43d00 consolidate more tests 7 年 前
.codecov.yml b74ffb2e03 import github.com/stretchr/testify/require 8 年 前
.gitignore 051434fab7 fix #198, use dep for vendoring 8 年 前
.travis.yml f29a0391bc travis: add 1.x to go versions 8 年 前
Gopkg.lock 051434fab7 fix #198, use dep for vendoring 8 年 前
Gopkg.toml 051434fab7 fix #198, use dep for vendoring 8 年 前
LICENSE 923358c07e Initial commit 9 年 前
README.md bca911dae0 Update README.md 7 年 前
build.sh 051434fab7 fix #198, use dep for vendoring 8 年 前
example_test.go 9ecb1fd36d fix go vet 8 年 前
feature_adapter.go 71f74dc71e implement #230 DisallowUnknownFields option added 7 年 前
feature_any.go b1b003864e expose OptionalEncoder&OptionalDecoder; add attachment to Stream&Iterator for customized decoder/encoder 8 年 前
feature_any_array.go d249b05a85 rename ValueType, to avoid collision with json.Number 8 年 前
feature_any_bool.go d249b05a85 rename ValueType, to avoid collision with json.Number 8 年 前
feature_any_float.go d249b05a85 rename ValueType, to avoid collision with json.Number 8 年 前
feature_any_int32.go d249b05a85 rename ValueType, to avoid collision with json.Number 8 年 前
feature_any_int64.go d249b05a85 rename ValueType, to avoid collision with json.Number 8 年 前
feature_any_invalid.go d249b05a85 rename ValueType, to avoid collision with json.Number 8 年 前
feature_any_nil.go d249b05a85 rename ValueType, to avoid collision with json.Number 8 年 前
feature_any_number.go 7990317be5 gofmt 7 年 前
feature_any_object.go d249b05a85 rename ValueType, to avoid collision with json.Number 8 年 前
feature_any_string.go d249b05a85 rename ValueType, to avoid collision with json.Number 8 年 前
feature_any_uint32.go d249b05a85 rename ValueType, to avoid collision with json.Number 8 年 前
feature_any_uint64.go d249b05a85 rename ValueType, to avoid collision with json.Number 8 年 前
feature_config.go 71f74dc71e implement #230 DisallowUnknownFields option added 7 年 前
feature_config_with_sync_map.go 07f99a1124 fix build 7 年 前
feature_config_without_sync_map.go 71f74dc71e implement #230 DisallowUnknownFields option added 7 年 前
feature_iter.go 9f088cbcc4 fix #195 when decode float as int, report it clearly 8 年 前
feature_iter_array.go 6240e1e798 #185 add jsoniter.Valid 8 年 前
feature_iter_float.go 25f147f530 add ReadNumber for Iterator. 8 年 前
feature_iter_int.go 13f86432b8 do not use defer() in read int 8 年 前
feature_iter_object.go 24bb2eee9f fix #236 case sensitive when both upper case and lower case presents 7 年 前
feature_iter_skip.go 6240e1e798 #185 add jsoniter.Valid 8 年 前
feature_iter_skip_sloppy.go 7e3b776024 change jsoniter-sloppy to jsoniter_sloppy 8 年 前
feature_iter_skip_sloppy_test.go 477be43d00 consolidate more tests 7 年 前
feature_iter_skip_strict.go 7e3b776024 change jsoniter-sloppy to jsoniter_sloppy 8 年 前
feature_iter_string.go 6240e1e798 #185 add jsoniter.Valid 8 年 前
feature_json_number.go 73c7bc881e fix #180, add missing methods to jsoniter.Number 8 年 前
feature_pool.go b1b003864e expose OptionalEncoder&OptionalDecoder; add attachment to Stream&Iterator for customized decoder/encoder 8 年 前
feature_reflect.go a9b9c73b4d fix #207 delay unsupported type error reporting 8 年 前
feature_reflect_array.go 807e4a8b20 Optimize 0-length array case 7 年 前
feature_reflect_extension.go c27f6f9350 config: add OnlyTaggedField config, only process tagged fields in struct 8 年 前
feature_reflect_map.go 945d1aaa19 fix #140 uintptr will no lock the address from gc 7 年 前
feature_reflect_native.go 75810179f6 remove n from stream 7 年 前
feature_reflect_object.go 24bb2eee9f fix #236 case sensitive when both upper case and lower case presents 7 年 前
feature_reflect_optional.go 0ab880662f fix #219 should check real value for empty instead of just the pointer for nested field 8 年 前
feature_reflect_slice.go 945d1aaa19 fix #140 uintptr will no lock the address from gc 7 年 前
feature_reflect_struct_decoder.go 24bb2eee9f fix #236 case sensitive when both upper case and lower case presents 7 年 前
feature_stream.go 75810179f6 remove n from stream 7 年 前
feature_stream_float.go 75810179f6 remove n from stream 7 年 前
feature_stream_int.go 75810179f6 remove n from stream 7 年 前
feature_stream_string.go 75810179f6 remove n from stream 7 年 前
feature_stream_test.go 75810179f6 remove n from stream 7 年 前
fuzzy_mode_convert_table.md 779c3e2164 update conversion table 8 年 前
jsoniter.go f0487718f6 document public symbols 8 年 前
test.sh e7c7f3b337 fix coverage 7 年 前

README.md

Sourcegraph GoDoc Build Status codecov rcard License Gitter chat

A high-performance 100% compatible drop-in replacement of "encoding/json"

You can also use thrift like JSON using thrift-iterator

Go开发者们请加入我们,滴滴出行平台技术部 taowen@didichuxing.com

Benchmark

benchmark

Source code: https://github.com/json-iterator/go-benchmark/blob/master/src/github.com/json-iterator/go-benchmark/benchmark_medium_payload_test.go

Raw Result (easyjson requires static code generation)

ns/op allocation bytes allocation times
std decode 35510 ns/op 1960 B/op 99 allocs/op
easyjson decode 8499 ns/op 160 B/op 4 allocs/op
jsoniter decode 5623 ns/op 160 B/op 3 allocs/op
std encode 2213 ns/op 712 B/op 5 allocs/op
easyjson encode 883 ns/op 576 B/op 3 allocs/op
jsoniter encode 837 ns/op 384 B/op 4 allocs/op

Usage

100% compatibility with standard lib

Replace

import "encoding/json"
json.Marshal(&data)

with

import "github.com/json-iterator/go"

var json = jsoniter.ConfigCompatibleWithStandardLibrary
json.Marshal(&data)

Replace

import "encoding/json"
json.Unmarshal(input, &data)

with

import "github.com/json-iterator/go"

var json = jsoniter.ConfigCompatibleWithStandardLibrary
json.Unmarshal(input, &data)

More documentation

How to get

go get github.com/json-iterator/go

Contribution Welcomed !

Contributors

Report issue or pull request, or email taowen@gmail.com, or Gitter chat