Sin descripción

Xargin 3bb49c1e47 add type def marshal/unmarshal test hace 8 años
extra dfa4bdf888 merge hace 8 años
output_tests e417330822 fuzzy test from 1000 to 100 hace 8 años
.codecov.yml b74ffb2e03 import github.com/stretchr/testify/require hace 8 años
.gitignore f60a6a17c2 test and cover multiple packages hace 8 años
.travis.yml 6a7bf91c45 only test against 1.8 hace 8 años
LICENSE 923358c07e Initial commit hace 9 años
README.md 8700644196 cut 0.9.18 hace 8 años
example_test.go f5edf564c8 gofmt hace 8 años
feature_adapter.go 678c297af3 #75 support MarshalIndent hace 8 años
feature_any.go f5edf564c8 gofmt hace 8 años
feature_any_array.go f5edf564c8 gofmt hace 8 años
feature_any_bool.go baca358b53 add MustBeValid to Any hace 8 años
feature_any_float.go 6129e85d53 increase coverage hace 8 años
feature_any_int32.go baca358b53 add MustBeValid to Any hace 8 años
feature_any_int64.go baca358b53 add MustBeValid to Any hace 8 años
feature_any_invalid.go baca358b53 add MustBeValid to Any hace 8 años
feature_any_nil.go baca358b53 add MustBeValid to Any hace 8 años
feature_any_number.go 712ddb1942 fix negative number to uint hace 8 años
feature_any_object.go 8675af13bf increase coverage hace 8 años
feature_any_string.go 1de44419ea increase coverage hace 8 años
feature_any_uint32.go baca358b53 add MustBeValid to Any hace 8 años
feature_any_uint64.go baca358b53 add MustBeValid to Any hace 8 años
feature_config.go 678c297af3 #75 support MarshalIndent hace 8 años
feature_iter.go f7df62f1b5 #115 check object end hace 8 años
feature_iter_array.go 818ae1331a #68 number to string hace 8 años
feature_iter_float.go 818ae1331a #68 number to string hace 8 años
feature_iter_int.go ff3c624fa9 fix anonymous fields hace 8 años
feature_iter_object.go 818ae1331a #68 number to string hace 8 años
feature_iter_skip.go 818ae1331a #68 number to string hace 8 años
feature_iter_string.go 818ae1331a #68 number to string hace 8 años
feature_pool.go 985e263300 #61 removed internal buffer from lazy array and object; jsoniter.Get replaced jsoniter.UnmarshalAny hace 8 años
feature_reflect.go bf002a02be #102 create correct type when pointer to Marshaler/Unmarshaler is nil hace 8 años
feature_reflect_array.go 1253b8edd3 gofmt hace 8 años
feature_reflect_extension.go ed6c434851 gofmt hace 8 años
feature_reflect_map.go 368bd0c1d8 fix 1.6 compatibility hace 8 años
feature_reflect_native.go ed6c434851 gofmt hace 8 años
feature_reflect_object.go f7df62f1b5 #115 check object end hace 8 años
feature_reflect_slice.go f771d32291 #70 decode null to nil for map/slice hace 8 años
feature_stream.go 678c297af3 #75 support MarshalIndent hace 8 años
feature_stream_float.go 550531a046 increase coverage hace 8 años
feature_stream_int.go d0418857ce #53 move current config EnableXXX hace 8 años
feature_stream_string.go 8f8e16b4c2 #63 keep struct field order hace 8 años
fuzzy_mode_convert_table.md ee3313111c add string tests hace 8 años
jsoniter_1dot8_only_test.go b74ffb2e03 import github.com/stretchr/testify/require hace 8 años
jsoniter_adapter_test.go b74ffb2e03 import github.com/stretchr/testify/require hace 8 años
jsoniter_alias_test.go 3bb49c1e47 add type def marshal/unmarshal test hace 8 años
jsoniter_any_array_test.go b74ffb2e03 import github.com/stretchr/testify/require hace 8 años
jsoniter_any_bool_test.go b74ffb2e03 import github.com/stretchr/testify/require hace 8 años
jsoniter_any_float_test.go b74ffb2e03 import github.com/stretchr/testify/require hace 8 años
jsoniter_any_int_test.go b74ffb2e03 import github.com/stretchr/testify/require hace 8 años
jsoniter_any_map_test.go b74ffb2e03 import github.com/stretchr/testify/require hace 8 años
jsoniter_any_null_test.go b74ffb2e03 import github.com/stretchr/testify/require hace 8 años
jsoniter_any_object_test.go b74ffb2e03 import github.com/stretchr/testify/require hace 8 años
jsoniter_any_string_test.go b74ffb2e03 import github.com/stretchr/testify/require hace 8 años
jsoniter_array_test.go b74ffb2e03 import github.com/stretchr/testify/require hace 8 años
jsoniter_bool_test.go b74ffb2e03 import github.com/stretchr/testify/require hace 8 años
jsoniter_customize_test.go b74ffb2e03 import github.com/stretchr/testify/require hace 8 años
jsoniter_demo_test.go b74ffb2e03 import github.com/stretchr/testify/require hace 8 años
jsoniter_find_end_test.go b74ffb2e03 import github.com/stretchr/testify/require hace 8 años
jsoniter_fixed_array_test.go b74ffb2e03 import github.com/stretchr/testify/require hace 8 años
jsoniter_float_test.go b74ffb2e03 import github.com/stretchr/testify/require hace 8 años
jsoniter_int_test.go e07a4ca5ec add int/int8/int32/int64 overflow test hace 8 años
jsoniter_interface_test.go b74ffb2e03 import github.com/stretchr/testify/require hace 8 años
jsoniter_invalid_test.go dfa4bdf888 merge hace 8 años
jsoniter_io_test.go b31b1301e2 #59 add ConfigFastest hace 8 años
jsoniter_iterator_test.go 8ab46965bd extract out any tests hace 8 años
jsoniter_large_file_test.go b31b1301e2 #59 add ConfigFastest hace 8 años
jsoniter_map_test.go e07a4ca5ec add int/int8/int32/int64 overflow test hace 8 años
jsoniter_must_be_valid_test.go b74ffb2e03 import github.com/stretchr/testify/require hace 8 años
jsoniter_nested_test.go 818ae1331a #68 number to string hace 8 años
jsoniter_null_test.go b74ffb2e03 import github.com/stretchr/testify/require hace 8 años
jsoniter_object_test.go b74ffb2e03 import github.com/stretchr/testify/require hace 8 años
jsoniter_optional_test.go b74ffb2e03 import github.com/stretchr/testify/require hace 8 años
jsoniter_raw_message_test.go b74ffb2e03 import github.com/stretchr/testify/require hace 8 años
jsoniter_reflect_native_test.go b31b1301e2 #59 add ConfigFastest hace 8 años
jsoniter_skip_test.go b74ffb2e03 import github.com/stretchr/testify/require hace 8 años
jsoniter_stream_test.go b74ffb2e03 import github.com/stretchr/testify/require hace 8 años
jsoniter_string_test.go b74ffb2e03 import github.com/stretchr/testify/require hace 8 años
jsoniter_wrap_test.go b74ffb2e03 import github.com/stretchr/testify/require hace 8 años
test.sh f60a6a17c2 test and cover multiple packages hace 8 años

README.md

Sourcegraph GoDoc Build Status codecov rcard License Gitter chat

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

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"
jsoniter.Marshal(&data)

Replace

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

with

import "github.com/json-iterator/go"
jsoniter.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