go icon indicating copy to clipboard operation
go copied to clipboard

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

Results 188 go issues
Sort by recently updated
recently updated
newest added

Adds a config option EmptyCollections to encode nil maps and slices as empty collections. Based on the issue described in more detail here: https://github.com/golang/go/issues/27589 but works with a configuration option.

Background: - When EscapeHTML=true, marshalling invalid UTF-8 byte will yield `\ufffd`, which is correct. - When EscapeHTML=false, marshalling invalid UTF-8 byte will keep the original byte remaining the same, which...

Just to explore how to fix #657 . A simple fix to recursive embedded types is to add recursion check. This, however, breaks other test cases. I found that it...

OS: window 10 go version: go1.19 windows/amd64 json-iterator: v1.1.12 purpose:unmarshal from 2d array string to 1d array and error will return ``` type Person struct { Age int64 `json:"age"` Name...

When I pass an `isEmptyFunc `function to `RegisterTypeEncoderFunc`, my `isEmptyFunc `is never called. My `EncoderFunc `for the type does get called. Request is for the `isEmptyFunc `to be called. My...

This is a PR that explores how to fix https://github.com/json-iterator/go/issues/657#issuecomment-1429702605. The `json:",string"` option incorrectly quotes value even when it must not be applied. If this patch is merged, it would...

- Using jsoniter.Marshal against struct types which contain recursive embedded type causes stack overflow. - std's `encoding/json` prevents this by [these lines](https://cs.opensource.google/go/go/+/refs/tags/go1.20:src/encoding/json/encode.go;l=1234-1237;bpv=1) - Jsoniter seemingly does not have that `visited`...

```go package main import ( "fmt" jsoniter "github.com/json-iterator/go" ) func main() { m := map[string]interface{}{ "3": 3, "1": 1, "2": 2, } json := jsoniter.ConfigCompatibleWithStandardLibrary b, err := json.Marshal(m) fmt.Printf(">>>...

Hi, I tested it with standard json it works fine ``` package main import ( "encoding/json" "fmt" "log" ) var ( // json = jsoniter.ConfigCompatibleWithStandardLibrary ) func main() { data...

`github.com/modern-go/concurrent` is an EOL. Any plan to use an alternative?