]> Cypherpunks repositories - gostls13.git/commit
encoding/csv: truncate carriage returns at EOF
authorJoe Tsai <joetsai@digital-static.net>
Fri, 1 Dec 2017 19:41:46 +0000 (11:41 -0800)
committerJoe Tsai <thebrokentoaster@gmail.com>
Tue, 5 Dec 2017 18:44:31 +0000 (18:44 +0000)
commit0b3b5113c0bbc62306a0404b235cbdf5a431bf67
tree30be829df15b36ba219cd618cd01d39d639ebe3b
parent8f2a9267c814538485dd3459910bc8e6de2ef2bb
encoding/csv: truncate carriage returns at EOF

This fixes a regression where only CRLF was folded into LF at EOF.
Now, we also truncate trailing CR at EOF to preserve the old behavior.

Every one of the test cases added exactly matches the behavior
of Go1.9, even if the results are somewhat unexpected.

Fixes #22937

Change-Id: I1bc6550533163ae489ea77ec1e598163267b7eec
Reviewed-on: https://go-review.googlesource.com/81577
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/encoding/csv/reader.go
src/encoding/csv/reader_test.go