Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
any_tests/ | H | 18-Nov-2020 | - | 911 | 748 | |
api_tests/ | H | 18-Nov-2020 | - | 485 | 415 | |
benchmarks/ | H | 18-Nov-2020 | - | 314 | 268 | |
extension_tests/ | H | 18-Nov-2020 | - | 345 | 296 | |
extra/ | H | 18-Nov-2020 | - | 1,222 | 1,061 | |
misc_tests/ | H | 18-Nov-2020 | - | 1,777 | 1,574 | |
skip_tests/ | H | 18-Nov-2020 | - | 316 | 285 | |
type_tests/ | H | 18-Nov-2020 | - | 1,745 | 1,555 | |
value_tests/ | H | 18-Nov-2020 | - | 1,765 | 1,604 | |
.codecov.yml | H A D | 18-Nov-2020 | 33 | 4 | 2 | |
.gitignore | H A D | 18-Nov-2020 | 42 | 5 | 4 | |
.travis.yml | H A D | 18-Nov-2020 | 159 | 15 | 10 | |
Gopkg.lock | H A D | 18-Nov-2020 | 588 | 22 | 17 | |
Gopkg.toml | H A D | 18-Nov-2020 | 712 | 27 | 24 | |
LICENSE | H A D | 18-Nov-2020 | 1 KiB | 22 | 17 | |
README.md | H A D | 18-Nov-2020 | 3 KiB | 88 | 60 | |
adapter.go | H A D | 18-Nov-2020 | 4.5 KiB | 151 | 94 | |
any.go | H A D | 18-Nov-2020 | 7 KiB | 326 | 282 | |
any_array.go | H A D | 18-Nov-2020 | 4.7 KiB | 279 | 239 | |
any_bool.go | H A D | 18-Nov-2020 | 1.8 KiB | 138 | 103 | |
any_float.go | H A D | 18-Nov-2020 | 1.2 KiB | 84 | 65 | |
any_int32.go | H A D | 18-Nov-2020 | 1.1 KiB | 75 | 56 | |
any_int64.go | H A D | 18-Nov-2020 | 1.1 KiB | 75 | 56 | |
any_invalid.go | H A D | 18-Nov-2020 | 1.3 KiB | 83 | 62 | |
any_nil.go | H A D | 18-Nov-2020 | 916 | 70 | 52 | |
any_number.go | H A D | 18-Nov-2020 | 2.6 KiB | 124 | 106 | |
any_object.go | H A D | 18-Nov-2020 | 6.8 KiB | 375 | 311 | |
any_str.go | H A D | 18-Nov-2020 | 2.8 KiB | 167 | 133 | |
any_uint32.go | H A D | 18-Nov-2020 | 1.1 KiB | 75 | 56 | |
any_uint64.go | H A D | 18-Nov-2020 | 1.1 KiB | 75 | 56 | |
build.sh | H A D | 18-Nov-2020 | 381 | 13 | 10 | |
config.go | H A D | 18-Nov-2020 | 10.3 KiB | 376 | 321 | |
example_test.go | H A D | 18-Nov-2020 | 2.6 KiB | 122 | 98 | |
fuzzy_mode_convert_table.md | H A D | 18-Nov-2020 | 927 | 7 | 7 | |
go.mod | H A D | 18-Nov-2020 | 295 | 12 | 9 | |
go.sum | H A D | 18-Nov-2020 | 1.4 KiB | 16 | 15 | |
iter.go | H A D | 18-Nov-2020 | 7.7 KiB | 350 | 300 | |
iter_array.go | H A D | 18-Nov-2020 | 1.4 KiB | 65 | 60 | |
iter_float.go | H A D | 18-Nov-2020 | 7.5 KiB | 343 | 313 | |
iter_int.go | H A D | 18-Nov-2020 | 8.6 KiB | 347 | 315 | |
iter_object.go | H A D | 18-Nov-2020 | 6.2 KiB | 268 | 255 | |
iter_skip.go | H A D | 18-Nov-2020 | 3.3 KiB | 131 | 111 | |
iter_skip_sloppy.go | H A D | 18-Nov-2020 | 3.2 KiB | 164 | 137 | |
iter_skip_sloppy_test.go | H A D | 18-Nov-2020 | 3.1 KiB | 163 | 154 | |
iter_skip_strict.go | H A D | 18-Nov-2020 | 2 KiB | 100 | 90 | |
iter_str.go | H A D | 18-Nov-2020 | 4.7 KiB | 216 | 197 | |
jsoniter.go | H A D | 18-Nov-2020 | 884 | 19 | 1 | |
pool.go | H A D | 18-Nov-2020 | 956 | 43 | 33 | |
reflect.go | H A D | 18-Nov-2020 | 8.5 KiB | 338 | 291 | |
reflect_array.go | H A D | 18-Nov-2020 | 2.6 KiB | 105 | 92 | |
reflect_dynamic.go | H A D | 18-Nov-2020 | 1.4 KiB | 71 | 62 | |
reflect_extension.go | H A D | 18-Nov-2020 | 14.2 KiB | 484 | 384 | |
reflect_json_number.go | H A D | 18-Nov-2020 | 2.6 KiB | 113 | 92 | |
reflect_json_raw_message.go | H A D | 18-Nov-2020 | 1.8 KiB | 77 | 64 | |
reflect_map.go | H A D | 18-Nov-2020 | 8.9 KiB | 347 | 318 | |
reflect_marshaler.go | H A D | 18-Nov-2020 | 5.8 KiB | 226 | 201 | |
reflect_native.go | H A D | 18-Nov-2020 | 10.9 KiB | 454 | 396 | |
reflect_optional.go | H A D | 18-Nov-2020 | 3.3 KiB | 130 | 105 | |
reflect_slice.go | H A D | 18-Nov-2020 | 2.6 KiB | 100 | 90 | |
reflect_struct_decoder.go | H A D | 18-Nov-2020 | 29.3 KiB | 1,098 | 1,058 | |
reflect_struct_encoder.go | H A D | 18-Nov-2020 | 5.2 KiB | 212 | 189 | |
stream.go | H A D | 18-Nov-2020 | 5.2 KiB | 211 | 149 | |
stream_float.go | H A D | 18-Nov-2020 | 2.7 KiB | 112 | 98 | |
stream_int.go | H A D | 18-Nov-2020 | 4.5 KiB | 191 | 166 | |
stream_str.go | H A D | 18-Nov-2020 | 7.8 KiB | 373 | 328 | |
stream_test.go | H A D | 18-Nov-2020 | 2.3 KiB | 87 | 68 | |
test.sh | H A D | 18-Nov-2020 | 285 | 13 | 9 |
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)](https://pkg.go.dev/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# Benchmark 14 15![benchmark](http://jsoniter.com/benchmarks/go-benchmark.png) 16 17Source code: https://github.com/json-iterator/go-benchmark/blob/master/src/github.com/json-iterator/go-benchmark/benchmark_medium_payload_test.go 18 19Raw Result (easyjson requires static code generation) 20 21| | ns/op | allocation bytes | allocation times | 22| --------------- | ----------- | ---------------- | ---------------- | 23| std decode | 35510 ns/op | 1960 B/op | 99 allocs/op | 24| easyjson decode | 8499 ns/op | 160 B/op | 4 allocs/op | 25| jsoniter decode | 5623 ns/op | 160 B/op | 3 allocs/op | 26| std encode | 2213 ns/op | 712 B/op | 5 allocs/op | 27| easyjson encode | 883 ns/op | 576 B/op | 3 allocs/op | 28| jsoniter encode | 837 ns/op | 384 B/op | 4 allocs/op | 29 30Always benchmark with your own workload. 31The result depends heavily on the data input. 32 33# Usage 34 35100% compatibility with standard lib 36 37Replace 38 39```go 40import "encoding/json" 41json.Marshal(&data) 42``` 43 44with 45 46```go 47import jsoniter "github.com/json-iterator/go" 48 49var json = jsoniter.ConfigCompatibleWithStandardLibrary 50json.Marshal(&data) 51``` 52 53Replace 54 55```go 56import "encoding/json" 57json.Unmarshal(input, &data) 58``` 59 60with 61 62```go 63import jsoniter "github.com/json-iterator/go" 64 65var json = jsoniter.ConfigCompatibleWithStandardLibrary 66json.Unmarshal(input, &data) 67``` 68 69[More documentation](http://jsoniter.com/migrate-from-go-std.html) 70 71# How to get 72 73``` 74go get github.com/json-iterator/go 75``` 76 77# Contribution Welcomed ! 78 79Contributors 80 81- [thockin](https://github.com/thockin) 82- [mattn](https://github.com/mattn) 83- [cch123](https://github.com/cch123) 84- [Oleg Shaldybin](https://github.com/olegshaldybin) 85- [Jason Toffaletti](https://github.com/toffaletti) 86 87Report 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) 88