forked from mirror/go-json
0943ec9fb8
Support json.Number |
||
---|---|---|
.github/workflows | ||
benchmarks | ||
LICENSE | ||
README.md | ||
decode.go | ||
decode_array.go | ||
decode_bool.go | ||
decode_compile.go | ||
decode_context.go | ||
decode_float.go | ||
decode_int.go | ||
decode_interface.go | ||
decode_map.go | ||
decode_number.go | ||
decode_ptr.go | ||
decode_slice.go | ||
decode_stream.go | ||
decode_string.go | ||
decode_struct.go | ||
decode_test.go | ||
decode_uint.go | ||
decode_unmarshal_json.go | ||
decode_unmarshal_text.go | ||
encode.go | ||
encode_compile.go | ||
encode_map112.go | ||
encode_map113.go | ||
encode_opcode.go | ||
encode_string.go | ||
encode_test.go | ||
encode_vm.go | ||
error.go | ||
go.mod | ||
go.sum | ||
helper_test.go | ||
json.go | ||
rtype.go |
README.md
go-json
Fast JSON encoder/decoder compatible with encoding/json for Go
Installation
go get github.com/goccy/go-json
How to use
Replace import statement from encoding/json
to github.com/goccy/go-json
-import "encoding/json"
+import "github.com/goccy/go-json"
Benchmarks
$ cd benchmarks
$ go test -bench .
Encode
Fastest
SmallStruct
MediumStruct
LargeStruct
Decode
So faster than json-iterator/go
json.Unmarshal
SmallStruct
MediumStruct
LargeStruct
Stream Decode
SmallStruct
MediumStruct
LargeStruct
Status
Type
Currently supported all types
API
Compact
HTMLEscape
Indent
Marshal
MarshalIndent
Unmarshal
Valid
NewDecoder
(*Decoder).Buffered
(*Decoder).Decode
(*Decoder).DisallowUnknownFields
(*Decoder).InputOffset
(*Decoder).More
(*Decoder).Token
(*Decoder).UseNumber
Delim
(Delim).String
NewEncoder
(*Encoder).Encode
(*Encoder).SetEscapeHTML
(*Encoder).SetIndent
Error
InvalidUTF8Error
InvalidUnmarshalError
MarshalerError
SyntaxError
UnmarshalFieldError
UnmarshalTypeError
UnsupportedTypeError
UnsupportedValueError
License
MIT