Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encoding/csv: blank lines no longer skipped (1.5) #11050

Closed
neild opened this issue Jun 3, 2015 · 4 comments
Closed

encoding/csv: blank lines no longer skipped (1.5) #11050

neild opened this issue Jun 3, 2015 · 4 comments
Milestone

Comments

@neild
Copy link
Contributor

neild commented Jun 3, 2015

The 1.4 csv package skips blank lines when TrimLeadingSpace is set. 1.5 does not.

package csv_test

import (
        "bytes"
        "encoding/csv"
        "testing"
)

func TestCSV(t *testing.T) {
        r := csv.NewReader(bytes.NewBufferString(`a,b,c

1,2,3
`))
        r.TrimLeadingSpace = true
        _, err := r.ReadAll()
        if err != nil {
                t.Errorf("r.ReadAll() = %v", err)
        }
}
$ go version
go version go1.4.2 linux/amd64
$ go test
PASS

$ /tmp/g/bin/go version
go version devel +f04e7bb Mon Jun 1 22:20:58 2015 +0000 linux/amd64
$ /tmp/g/bin/go test
--- FAIL: TestCSV (0.00s)
        csv_test.go:17: r.ReadAll() = line 2, column 0: wrong number of fields in line
FAIL
@neild
Copy link
Contributor Author

neild commented Jun 3, 2015

@ianlancetaylor ianlancetaylor added this to the Go1.5 milestone Jun 3, 2015
@neild
Copy link
Contributor Author

neild commented Jun 3, 2015

TrimLeadingSpace is actually irrelevant; same behavior goes without it.

@neild neild changed the title encoding/csv: blank lines no longer skipped when TrimLeadingSpace=true (1.5) encoding/csv: blank lines no longer skipped (1.5) Jun 3, 2015
@neild
Copy link
Contributor Author

neild commented Jun 3, 2015

@gopherbot
Copy link

CL https://golang.org/cl/10666 mentions this issue.

@golang golang locked and limited conversation to collaborators Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants