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

context.JSON adds a new line to end of JSON response #2209

Open
kishaningithub opened this issue Jan 15, 2020 · 0 comments
Open

context.JSON adds a new line to end of JSON response #2209

kishaningithub opened this issue Jan 15, 2020 · 0 comments

Comments

@kishaningithub
Copy link

@kishaningithub kishaningithub commented Jan 15, 2020

Description

context.JSON() adds a new line character \n to end of JSON response

How to reproduce

Clone this repo and run

$ GIN_MODE=release go run gin-newline.go

Expectations

Newline character ("\n") must not get added to the end of {"message":"hello world"}

Actual result

new line character gets added

Environment

  • go version: 1.13.5
  • gin version (or commit ref): v1.5.0
  • operating system: mac os
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.