go
go copied to clipboard
A high-performance 100% compatible drop-in replacement of "encoding/json"

`reflect2` is too brittle because of the reliance on the internals of the golang's compiler. Moreover, it is no longer maintained: [github.com/modern-go/reflect2.](https://github.com/modern-go/reflect2/issues/24#issuecomment-916998286). Replace the usages of `github.com/modern-go/reflect2` with stdlib's `reflect`.
unexpected fault address 0x360808085a175a75 fatal error: fault [signal SIGSEGV: segmentation violation code=0x2 addr=0x360808085a175a75 pc=0x100cf3cf0] goroutine 154 [running]: runtime.throw({0x10129c203?, 0x100cfbcec?}) /Users/zhongshitao/go1.18.10/src/runtime/panic.go:992 +0x50 fp=0x140128d5490 sp=0x140128d5460 pc=0x100cc3d50 runtime.sigpanic() /Users/zhongshitao/go1.18.10/src/runtime/signal_unix.go:825 +0x1a4 fp=0x140128d54c0 sp=0x140128d5490 pc=0x100cdadc4...
Cannot unmarshal null fields to UUID, even though I already uses `ConfigCompatibleWithStandardLibrary` which ensures 100% compatibility. It also fails with the NewDecoder.Decode function. Sample Program: ```go package main import (...
A field that uses a custom marshaler does not adhere to the `omitempty` tag the same way that `encoding/json` does. Example go playground: https://go.dev/play/p/ccfrr3rvac3
This PR adds a typed `IteratorError` which enables consumers to check against jsonitor iterator errors via `errors.As` (directly or if the error itself is wrapped), as well as provide the...
I found a use case where the `Unmarshal` function does not return the same value as the standard `encoding/json` package. https://go.dev/play/p/PZQ9WZlZ52v If you use `{{}}` as a input you should...
* make a `json` subdirectory * make a file with: ```go package json import jsoniter "github.com/json-iterator/go" var json = jsoniter.ConfigCompatibleWithStandardLibrary func Marshal(v any) (b []byte, error) { return json.Marshal(v) }...