# go-json
![Go](https://github.com/goccy/go-json/workflows/Go/badge.svg)
[![GoDoc](https://godoc.org/github.com/goccy/go-json?status.svg)](https://pkg.go.dev/github.com/goccy/go-json?tab=doc)
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`
- [x] `Marshal`
- [x] `MarshalIndent`
- [x] `Unmarshal`
- [ ] `Valid`
- [x] `NewDecoder`
- [x] `(*Decoder).Buffered`
- [x] `(*Decoder).Decode`
- [x] `(*Decoder).DisallowUnknownFields`
- [x] `(*Decoder).InputOffset`
- [x] `(*Decoder).More`
- [x] `(*Decoder).Token`
- [x] `(*Decoder).UseNumber`
- [x] `Delim`
- [x] `(Delim).String`
- [x] `NewEncoder`
- [x] `(*Encoder).Encode`
- [x] `(*Encoder).SetEscapeHTML`
- [x] `(*Encoder).SetIndent`
### Error
- [ ] `InvalidUTF8Error`
- [x] `InvalidUnmarshalError`
- [x] `MarshalerError`
- [x] `SyntaxError`
- [ ] `UnmarshalFieldError`
- [ ] `UnmarshalTypeError`
- [x] `UnsupportedTypeError`
- [x] `UnsupportedValueError`
# License
MIT