go
go copied to clipboard
A high-performance 100% compatible drop-in replacement of "encoding/json"
hi, I have a json string whose size is more than 150000 bytes. It turned out that encoding/json library can unmarshal this json string correctly but json-iterator can not based...
protobuf/jsonpb is using encoding/json with some modification to convert between protocol buffer and json, which is used by grpc-gateway to generate a HTTP proxy to gRPC backend service. I tried...
[`func (iter *Iterator) ReadObject() (ret string)`](https://github.com/json-iterator/go/blob/71ac16282d122fdd1e3a6d3e7f79b79b4cc3b50e/iter_object.go#L11-L46) > ReadObject read one field from object. If object ended, returns empty string. Otherwise, returns the field name. https://github.com/json-iterator/go/blob/71ac16282d122fdd1e3a6d3e7f79b79b4cc3b50e/iter_object.go#L40-L41 The problem with this is,...
``` p := DataTime{ DateFormat: "yyyy/MM/dd", TimeFormat: "HH:mm", } any := jsoniter.Wrap(p) t.Logf("type object:%v", any.ValueType() == jsoniter.ObjectValue) t.Logf("string:%v", any.ToString()) s, _ := jsoniter.MarshalToString(any) t.Logf("serial json:%v", s) any.ToVal(&p) t.Logf("to object:%v", p)...
I have the requirement to serialize the same type in different formats depending on certain scenarios (REST API retrocompatibility). Is there is a way to do so?
We used the Fuzz engine to modify some Test(Test_append_skip_and_return_bytes_with_reader) data, and then the following timeout appeared. We hope to get the help of the developer to confirm whether it is...
json-iterator is not returning io.EOF error after decoding all the entries. Instead we are getting the following string. `readObjectStart: expect { or n, but found , error found in #2...
2022-11-09 20:34:40.460 ERROR logs/recovery.go:75 [RECOVERY] 2022/11/09 - 20:34:40 panic recovered: runtime error: invalid memory address or nil pointer dereference /root/.gvm/gos/go1.19/src/runtime/panic.go:884 (0x4394f1) gopanic: ??? /root/.gvm/pkgsets/go1.19/global/pkg/mod/go.opentelemetry.io/otel/[email protected]/trace/span.go:227 (0x11cdc69) (*span).End.func1: ??? /root/.gvm/pkgsets/go1.19/global/pkg/mod/go.opentelemetry.io/otel/[email protected]/trace/span.go:259 (0x11cdb32) (*span).End:...
Hi, thanks for the project! I was wondering if is there any option or feature in progress that can always add omitEmpty to the struct. We have a pretty big...
go version: go1.18.3 test code: `package main` `import (` ` "github.com/json-iterator/go"` `)` `func main() {` ` var req = map[string]interface{}{` ` "a": "b",` ` }` ` jsoniter.Marshal(req)` `}` got: `unexpected...