Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
encoding/csv: clarify that Writer uses different line break than RFC …
…4180 by default Package documentation of encoding/csv says: > this package supports the format described in RFC 4180. https://pkg.go.dev/encoding/csv#section-documentation According to section 2 of RFC 4180: > Each record is located on a separate line, delimited by a line break (CRLF). https://www.rfc-editor.org/rfc/rfc4180.html#section-2 On the other hand, encoding/csv.Writer uses LF (not CRLF) as newline character by default. > If [Writer.UseCRLF] is true, the Writer ends each output line with \r\n instead of \n. https://pkg.go.dev/encoding/csv#Writer https://github.com/golang/go/blob/1259a30a588392e6a1efbed9e0c7d893c72187fa/src/encoding/csv/writer.go#L115-L119 Strictly speaking, this behavior is different from RFC 4180. Package documentation would improve if we clarify that point.
- Loading branch information