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: conflicting comments regarding column indexing #62147

Closed
krmpotic opened this issue Aug 18, 2023 · 3 comments
Closed

encoding/csv: conflicting comments regarding column indexing #62147

krmpotic opened this issue Aug 18, 2023 · 3 comments
Labels
Documentation NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@krmpotic
Copy link
Contributor

krmpotic commented Aug 18, 2023

// A ParseError is returned for parsing errors.
// Line numbers are 1-indexed and columns are 0-indexed.
type ParseError struct {
StartLine int // Line where the record starts
Line int // Line where the error occurred
Column int // Column (1-based byte index) where the error occurred
Err error // The actual error
}

comments of ParseError struct and of its element Column are in conflict with each-other, regarding
columns being 1-indexed or 0-indexed

@seankhliao
Copy link
Member

looks like it should be 1 indexed.

@seankhliao seankhliao added Documentation NeedsFix The path to resolution is known, but the work has not been done. labels Aug 18, 2023
@ianlancetaylor
Copy link
Contributor

Thanks. Looks like we improved it in https://go.dev/cl/291290 for #44221 but didn't fully update the docs. CC @rogpeppe

@gopherbot
Copy link

Change https://go.dev/cl/520917 mentions this issue: encoding/csv: correct Column docs

@dmitshur dmitshur added this to the Go1.22 milestone Aug 19, 2023
cellularmitosis pushed a commit to cellularmitosis/go that referenced this issue Aug 24, 2023
For golang#44221
Fixes golang#62147

Change-Id: Ibcc0d11c8253f51a8f5771791ea4173a38a61950
Reviewed-on: https://go-review.googlesource.com/c/go/+/520917
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

5 participants