Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 10-Apr-2019 | - | ||||
LICENSE | H A D | 10-Apr-2019 | 1 KiB | 22 | 17 | |
README.md | H A D | 10-Apr-2019 | 2.9 KiB | 92 | 63 | |
adapter.go | H A D | 10-Apr-2019 | 4.3 KiB | 149 | 92 | |
any.go | H A D | 10-Apr-2019 | 7 KiB | 322 | 278 | |
any_array.go | H A D | 10-Apr-2019 | 4.7 KiB | 279 | 239 | |
any_bool.go | H A D | 10-Apr-2019 | 1.8 KiB | 138 | 103 | |
any_float.go | H A D | 10-Apr-2019 | 1.2 KiB | 84 | 65 | |
any_int32.go | H A D | 10-Apr-2019 | 1.1 KiB | 75 | 56 | |
any_int64.go | H A D | 10-Apr-2019 | 1.1 KiB | 75 | 56 | |
any_invalid.go | H A D | 10-Apr-2019 | 1.3 KiB | 83 | 62 | |
any_nil.go | H A D | 10-Apr-2019 | 916 | 70 | 52 | |
any_number.go | H A D | 10-Apr-2019 | 2.6 KiB | 124 | 106 | |
any_object.go | H A D | 10-Apr-2019 | 6.8 KiB | 375 | 311 | |
any_str.go | H A D | 10-Apr-2019 | 2.8 KiB | 167 | 133 | |
any_uint32.go | H A D | 10-Apr-2019 | 1.1 KiB | 75 | 56 | |
any_uint64.go | H A D | 10-Apr-2019 | 1.1 KiB | 75 | 56 | |
config.go | H A D | 10-Apr-2019 | 10.1 KiB | 373 | 318 | |
iter.go | H A D | 10-Apr-2019 | 7.1 KiB | 323 | 277 | |
iter_array.go | H A D | 10-Apr-2019 | 1.2 KiB | 59 | 54 | |
iter_float.go | H A D | 10-Apr-2019 | 7.5 KiB | 348 | 318 | |
iter_int.go | H A D | 10-Apr-2019 | 8.5 KiB | 346 | 314 | |
iter_object.go | H A D | 10-Apr-2019 | 5.8 KiB | 253 | 240 | |
iter_skip.go | H A D | 10-Apr-2019 | 3.2 KiB | 130 | 113 | |
iter_skip_sloppy.go | H A D | 10-Apr-2019 | 2.9 KiB | 145 | 119 | |
iter_skip_strict.go | H A D | 10-Apr-2019 | 1.8 KiB | 90 | 80 | |
iter_str.go | H A D | 10-Apr-2019 | 4.7 KiB | 216 | 197 | |
jsoniter.go | H A D | 10-Apr-2019 | 884 | 19 | 1 | |
pool.go | H A D | 10-Apr-2019 | 956 | 43 | 33 | |
reflect.go | H A D | 10-Apr-2019 | 8.3 KiB | 331 | 284 | |
reflect_array.go | H A D | 10-Apr-2019 | 2.6 KiB | 105 | 92 | |
reflect_dynamic.go | H A D | 10-Apr-2019 | 1.4 KiB | 71 | 62 | |
reflect_extension.go | H A D | 10-Apr-2019 | 13.7 KiB | 472 | 372 | |
reflect_json_number.go | H A D | 10-Apr-2019 | 2.6 KiB | 113 | 92 | |
reflect_json_raw_message.go | H A D | 10-Apr-2019 | 1.6 KiB | 61 | 48 | |
reflect_map.go | H A D | 10-Apr-2019 | 8.4 KiB | 319 | 294 | |
reflect_marshaler.go | H A D | 10-Apr-2019 | 5.7 KiB | 219 | 197 | |
reflect_native.go | H A D | 10-Apr-2019 | 10.8 KiB | 452 | 394 | |
reflect_optional.go | H A D | 10-Apr-2019 | 3.4 KiB | 134 | 109 | |
reflect_slice.go | H A D | 10-Apr-2019 | 2.6 KiB | 100 | 90 | |
reflect_struct_decoder.go | H A D | 10-Apr-2019 | 28.1 KiB | 1,049 | 1,010 | |
reflect_struct_encoder.go | H A D | 10-Apr-2019 | 5.1 KiB | 211 | 188 | |
stream.go | H A D | 10-Apr-2019 | 5.2 KiB | 212 | 150 | |
stream_float.go | H A D | 10-Apr-2019 | 2.2 KiB | 95 | 81 | |
stream_int.go | H A D | 10-Apr-2019 | 4.5 KiB | 191 | 166 | |
stream_str.go | H A D | 10-Apr-2019 | 7.8 KiB | 373 | 328 |
README.md
1[![Sourcegraph](https://sourcegraph.com/github.com/json-iterator/go/-/badge.svg)](https://sourcegraph.com/github.com/json-iterator/go?badge) 2[![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](http://godoc.org/github.com/json-iterator/go) 3[![Build Status](https://travis-ci.org/json-iterator/go.svg?branch=master)](https://travis-ci.org/json-iterator/go) 4[![codecov](https://codecov.io/gh/json-iterator/go/branch/master/graph/badge.svg)](https://codecov.io/gh/json-iterator/go) 5[![rcard](https://goreportcard.com/badge/github.com/json-iterator/go)](https://goreportcard.com/report/github.com/json-iterator/go) 6[![License](http://img.shields.io/badge/license-mit-blue.svg?style=flat-square)](https://raw.githubusercontent.com/json-iterator/go/master/LICENSE) 7[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/json-iterator/Lobby) 8 9A high-performance 100% compatible drop-in replacement of "encoding/json" 10 11You can also use thrift like JSON using [thrift-iterator](https://github.com/thrift-iterator/go) 12 13``` 14Go开发者们请加入我们,滴滴出行平台技术部 taowen@didichuxing.com 15``` 16 17# Benchmark 18 19![benchmark](http://jsoniter.com/benchmarks/go-benchmark.png) 20 21Source code: https://github.com/json-iterator/go-benchmark/blob/master/src/github.com/json-iterator/go-benchmark/benchmark_medium_payload_test.go 22 23Raw Result (easyjson requires static code generation) 24 25| | ns/op | allocation bytes | allocation times | 26| --- | --- | --- | --- | 27| std decode | 35510 ns/op | 1960 B/op | 99 allocs/op | 28| easyjson decode | 8499 ns/op | 160 B/op | 4 allocs/op | 29| jsoniter decode | 5623 ns/op | 160 B/op | 3 allocs/op | 30| std encode | 2213 ns/op | 712 B/op | 5 allocs/op | 31| easyjson encode | 883 ns/op | 576 B/op | 3 allocs/op | 32| jsoniter encode | 837 ns/op | 384 B/op | 4 allocs/op | 33 34Always benchmark with your own workload. 35The result depends heavily on the data input. 36 37# Usage 38 39100% compatibility with standard lib 40 41Replace 42 43```go 44import "encoding/json" 45json.Marshal(&data) 46``` 47 48with 49 50```go 51import "github.com/json-iterator/go" 52 53var json = jsoniter.ConfigCompatibleWithStandardLibrary 54json.Marshal(&data) 55``` 56 57Replace 58 59```go 60import "encoding/json" 61json.Unmarshal(input, &data) 62``` 63 64with 65 66```go 67import "github.com/json-iterator/go" 68 69var json = jsoniter.ConfigCompatibleWithStandardLibrary 70json.Unmarshal(input, &data) 71``` 72 73[More documentation](http://jsoniter.com/migrate-from-go-std.html) 74 75# How to get 76 77``` 78go get github.com/json-iterator/go 79``` 80 81# Contribution Welcomed ! 82 83Contributors 84 85* [thockin](https://github.com/thockin) 86* [mattn](https://github.com/mattn) 87* [cch123](https://github.com/cch123) 88* [Oleg Shaldybin](https://github.com/olegshaldybin) 89* [Jason Toffaletti](https://github.com/toffaletti) 90 91Report issue or pull request, or email taowen@gmail.com, or [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/json-iterator/Lobby) 92