Closed
Description
Proposal Details
The encoding/json Encoder outputs JSON values as single lines of text since its original version and this is a design choice (see @rsc claim). This makes it an early implementation of the JSON Lines standard.
However this feature is undocumented: nothing about the absence of \n
in doc for Encoder
, Encoder.Encode
(or json.Marshal
). As this is undocumented, users can't rely on this implementation detail (but I expect many rely on it anyway).
This proposal is about extending the Encoder.Encode
documentation to guarantee that no raw \n
or \r
is produced inside a JSON value.