Encoder does not print newlines
Closed this issue · 3 comments
colinking commented
Here's an example: https://goplay.space/#aJgJu9bSfOV
From looking at the code, it looks like the encoder prints a newline via printSpace
which is disabled if compact=true
. AFAICT, those are only relevant to MarshalIndent
.
colinking commented
Here's the corresponding encoding/json
version which does print the newline: https://goplay.space/#35zNP_wOjQy
nwidger commented
@colinking Thanks for reporting this issue! I opened a PR #6 that I hope will fix this issue. Would you mind trying out the issue-5-encoder-does-not-print-newlines
branch and letting me know?