aboutsummaryrefslogtreecommitdiff
path: root/src/encoding/csv/reader.go
diff options
context:
space:
mode:
authorIvoGoman <ivo.gosemann@gmail.com>2023-05-09 20:46:23 +0000
committerGopher Robot <gobot@golang.org>2023-05-10 13:00:20 +0000
commit607a04588886b3d605500942f20de9dbab02ed9d (patch)
tree3a513f24e674165474b3b2dfb5ba2b1bdfe5c785 /src/encoding/csv/reader.go
parent57e3189821c6525fc8eecac42c3faad3b5416223 (diff)
downloadgo-607a04588886b3d605500942f20de9dbab02ed9d.tar.xz
encoding/csv: update doc comment of Read method
This updates the doc comment to reflect the behavior of the method. On error the method returns a partial result. Fixes #59991 Change-Id: I71e9dfa37e0488c85abd3eeede2a1a34cb74239b GitHub-Last-Rev: 389488e5364dc939f0cbd11f99eb56001b5237a2 GitHub-Pull-Request: golang/go#60084 Reviewed-on: https://go-review.googlesource.com/c/go/+/494055 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Benny Siegert <bsiegert@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'src/encoding/csv/reader.go')
-rw-r--r--src/encoding/csv/reader.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/encoding/csv/reader.go b/src/encoding/csv/reader.go
index b83208eb3a..c6a8ed02c1 100644
--- a/src/encoding/csv/reader.go
+++ b/src/encoding/csv/reader.go
@@ -187,8 +187,9 @@ func NewReader(r io.Reader) *Reader {
// Read reads one record (a slice of fields) from r.
// If the record has an unexpected number of fields,
// Read returns the record along with the error ErrFieldCount.
-// Except for that case, Read always returns either a non-nil
-// record or a non-nil error, but not both.
+// If the record contains a field that cannot be parsed,
+// Read returns a partial record along with the parse error.
+// The partial record contains all fields read before the error.
// If there is no data left to be read, Read returns nil, io.EOF.
// If ReuseRecord is true, the returned slice may be shared
// between multiple calls to Read.