json-iterator/go

[BUG]use ".MarshalIndent" panic

Tiper-In-Github opened this issue · 0 comments

The following code runs fine in the original package, but panics after replacing it with jsoniter:

func() {
  // resp is the structure generated by protobuf
  // Return json when requested in Hex
  if byteRes, err := jsoniter.MarshalIndent(resp, "", "\t"); err == nil {
	  c.Writer.Write(byteRes)
  }
}

More details

  • go:1.22.5
  • jsoniter:v1.1.12
  • Protobuf:use

proto:
pkg: google.golang.org/protobuf
// versions:
// protoc-gen-go v1.34.2
// protoc v5.27.2