Replies: 1 comment
-
This is because of Line 19 in deb17d2 encoder.Encode method adds newline but function json.Marshal() does not.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm bumping into something that made me curious.
When returning a JSON response, the body is ended with a newline.
I can't find any APIs that does this for their JSON responses.
Also, going back to older APIs that I have built and/or that are in our organization I can also see that none of them return JSON bodies with a newline at the end.
Does anyone know why echo adds a newline for JSON responses?
A quick example:
This simple route returns with a newline at the end
However, if I return a string, no newline is added
Beta Was this translation helpful? Give feedback.
All reactions