Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]use ".MarshalIndent" panic #704

Open
Tiper-In-Github opened this issue Oct 18, 2024 · 0 comments
Open

[BUG]use ".MarshalIndent" panic #704

Tiper-In-Github opened this issue Oct 18, 2024 · 0 comments

Comments

@Tiper-In-Github
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@Tiper-In-Github and others