go
go copied to clipboard
A high-performance 100% compatible drop-in replacement of "encoding/json"
The current error returns are all strings, it seems difficult to handle errors conveniently
In the following snippet we provide a bad timestamp "bad" into the BadUnmarshalContent field: ```go package main import ( "fmt" "time" jsoniter "github.com/json-iterator/go" ) func main() { var json =...
similarly to ReadStringAsSlice(), ReadObjectAsSlice() reads an object from the iterator without converting to the string type. The result cannot be kept around, as it is valid only until the next...
rel https://github.com/json-iterator/go/issues/486 - decode the followings as boolean: `"true"`, `"false"`, `0`, `1`, `"0"`, `"1"`. - allow unmarshalling numeric keyed objects with strictly increasing keys as array, eg: `{"0": "a", "2":...
We use jsoniter's Unmarshal and change the numeric field Unmarshal to json.Number, but found that the data format after Unmarshal is stdjson.Number instead of jsoniter.Number. I don’t know the purpose...
Could json-iterator support auto lowercase json field? code example: ```go type User struct { ID int `json:"-"` Name string Age int Email string QQNumber string `json:"QQ"` } user := User{...
fmt.*printf's "%s" verb converts values to strings in a performant way so no need to cast and unnecessarily allocate byteslice->string conversions. Noticed from our benchmarking per https://dashboard.github.orijtech.com/benchmark/3245b8e4bbbd44a597480319aaa4b9fe that avoiding this...
go version : 16.3 ENV : PRODUCTION stack: panic({0x12fc400, 0xc000c24600}) /micro/go/src/runtime/panic.go:1038 +0x215 github.com/json-iterator/go.(*frozenConfig).getEncoderFromCache(...) /var/lib/jenkins/workspace/UserService/vendor/github.com/json-iterator/go/config.go:109 github.com/json-iterator/go.(*Stream).WriteVal(0xc003e80480, {0x13dfc60, 0xc0023dd0c0}) /var/lib/jenkins/workspace/UserService/vendor/github.com/json-iterator/go/reflect.go:93 +0x105 github.com/json-iterator/go.(*frozenConfig).MarshalToString(0xc000133ae0, {0x13dfc60, 0xc0023dd0c0}) /var/lib/jenkins/workspace/UserService/vendor/github.com/json-iterator/go/config.go:289 +0xa6 github.com/json-iterator/go.MarshalToString(...) /var/lib/jenkins/workspace/UserService/vendor/github.com/json-iterator/go/adapter.go:44 I've read json-iterator/go/config.go 109,...
```go type P struct { ID *uint64 `json:"id,string"` } func main() { var p = P { ID: nil, } js, err := json.Marshal(p) if err!=nil { fmt.Println(err.Error()) } fmt.Printf("p...
panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x57b364] goroutine 22 [running]: github.com/json-iterator/go.(*Stream).WriteStringWithHTMLEscaped(0xc4202fec60, 0x0, 0x36) /home/gitlab-runner/sy_go/src/github.com/json-iterator/go/feature_stream_string.go:235 +0x94 github.com/json-iterator/go.(*htmlEscapedStringEncoder).Encode(0x16d4000, 0xc4210e4ea8, 0xc4202fec60) /home/gitlab-runner/sy_go/src/github.com/json-iterator/go/feature_config.go:182 +0x41...