From 90d43ad720a4669878bcabf14c4ea915557c0545 Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Wed, 8 Feb 2012 14:24:04 +1100 Subject: [PATCH] encoding/csv: document ReadAll behavior at EOF Fixes #2847. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5641050 --- src/pkg/encoding/csv/reader.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pkg/encoding/csv/reader.go b/src/pkg/encoding/csv/reader.go index ae0f567b9df..9aa398e58b2 100644 --- a/src/pkg/encoding/csv/reader.go +++ b/src/pkg/encoding/csv/reader.go @@ -156,6 +156,9 @@ func (r *Reader) Read() (record []string, err error) { // ReadAll reads all the remaining records from r. // 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) { for { record, err := r.Read()