mirror of
https://github.com/golang/go
synced 2024-11-22 00:04:41 -07:00
encoding/csv: document ReadAll behavior at EOF
Fixes #2847. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5641050
This commit is contained in:
parent
c02db82b83
commit
90d43ad720
@ -156,6 +156,9 @@ func (r *Reader) Read() (record []string, err error) {
|
|||||||
|
|
||||||
// ReadAll reads all the remaining records from r.
|
// ReadAll reads all the remaining records from r.
|
||||||
// Each record is a slice of fields.
|
// Each record is a slice of fields.
|
||||||
|
// A successful call returns err == nil, not err == EOF. Because ReadAll is
|
||||||
|
// defined to read until EOF, it does not treat end of file as an error to be
|
||||||
|
// reported.
|
||||||
func (r *Reader) ReadAll() (records [][]string, err error) {
|
func (r *Reader) ReadAll() (records [][]string, err error) {
|
||||||
for {
|
for {
|
||||||
record, err := r.Read()
|
record, err := r.Read()
|
||||||
|
Loading…
Reference in New Issue
Block a user