]> Cypherpunks repositories - gostls13.git/commitdiff
encoding/csv: update doc comment of Read method
authorIvoGoman <ivo.gosemann@gmail.com>
Tue, 9 May 2023 20:46:23 +0000 (20:46 +0000)
committerGopher Robot <gobot@golang.org>
Wed, 10 May 2023 13:00:20 +0000 (13:00 +0000)
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>

src/encoding/csv/reader.go

index b83208eb3a4f26983372b4b8d692b5fdeeab629b..c6a8ed02c154a1d6beaa72b732fb5893506b3b08 100644 (file)
@@ -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.