New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
encoding/csv: clarify that Writer uses different line break than RFC 4180 by default #67290
Conversation
This PR (HEAD: 1523038) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/584835. Important tips:
|
Message from Gopher Robot: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/584835. |
Message from Ian Lance Taylor: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/584835. |
1523038
to
31222e0
Compare
This PR (HEAD: 31222e0) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/584835. Important tips:
|
31222e0
to
e322fed
Compare
This PR (HEAD: e322fed) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/584835. Important tips:
|
…4180 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.
e322fed
to
489167e
Compare
This PR (HEAD: 489167e) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/584835. Important tips:
|
Message from のびしー: Patch Set 4: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/584835. |
Message from Ian Lance Taylor: Patch Set 4: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/584835. |
Message from Ian Lance Taylor: Patch Set 4: Auto-Submit+1 Code-Review+2 Commit-Queue+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/584835. |
Message from Go LUCI: Patch Set 4: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2024-05-11T03:10:47Z","revision":"0cee453234d5daa3b108d99360ffb1353344ee9f"} Please don’t reply on this GitHub thread. Visit golang.org/cl/584835. |
Message from のびしー: Patch Set 4: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/584835. |
Message from Ian Lance Taylor: Patch Set 4: -Commit-Queue Please don’t reply on this GitHub thread. Visit golang.org/cl/584835. |
Message from Go LUCI: Patch Set 4: This CL has passed the run Please don’t reply on this GitHub thread. Visit golang.org/cl/584835. |
Message from Go LUCI: Patch Set 4: LUCI-TryBot-Result+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/584835. |
…4180 by default Package documentation of encoding/csv says: > this package supports the format described in RFC 4180. According to section 2 of RFC 4180: > Each record is located on a separate line, delimited by a line break (CRLF). On the other hand, 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. Strictly speaking, this behavior is different from RFC 4180. Package documentation would improve if we clarify that point. Change-Id: I120e9332b593e1ac9ed8e49f6f8419ea88efc57d GitHub-Last-Rev: 489167e GitHub-Pull-Request: #67290 Reviewed-on: https://go-review.googlesource.com/c/go/+/584835 LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Dmitri Shuralyov <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
Message from Dmitri Shuralyov: Patch Set 5: Auto-Submit+1 Code-Review+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/584835. |
This PR is being closed because golang.org/cl/584835 has been merged. |
Package documentation of encoding/csv says:
According to section 2 of RFC 4180:
On the other hand, Writer uses LF (not CRLF) as newline character by default.
Strictly speaking, this behavior is different from RFC 4180.
Package documentation would improve if we clarify that point.