Replies: 1 comment 1 reply
-
Echo uses standard library to encode JSON. Lines 15 to 19 in 5e791b0 This is similar question with answer where and when and why this newline is added https://stackoverflow.com/a/36320146 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am writing some uint test and I found that the c.JSON function will add a
\n
to the end of JSON response and leads my test fails.In the documentation, the testing data doesn't contains the
\n
, however in thejson_test.go
it does.And when I search this issue on the internet,
gin
framework also has this issue before and they treated it is as a bug and fixed it.How about
echo
? Is there any reason keeping this strange behaviour?here is a simple demo to reproduce the issue:
https://github.com/yu-yk/echo-newline
Beta Was this translation helpful? Give feedback.
All reactions