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

go/token: incorrect interval in panic messages #46215

Closed
findleyr opened this issue May 17, 2021 · 3 comments
Closed

go/token: incorrect interval in panic messages #46215

findleyr opened this issue May 17, 2021 · 3 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@findleyr
Copy link
Contributor

findleyr commented May 17, 2021

CL 262017 improved the panic messages produced by go/token on out of bounds position queries. However, it looks like there's a typo in the bounds notation, for example: panic: invalid Pos value 98 (should be in [1, 75[). The interval should be [1, 75]. This typo occurs in two locations.

Filing as an issue as this is trivial and it would be nice to fix it for 1.17. I'll send a CL.

CC @griesemer

@findleyr findleyr added the NeedsFix The path to resolution is known, but the work has not been done. label May 17, 2021
@findleyr findleyr added this to the Go1.17 milestone May 17, 2021
@findleyr findleyr self-assigned this May 17, 2021
@findleyr findleyr changed the title go/ast: typos in interval notation in panic messages go/token: typos in interval notation in panic messages May 17, 2021
@gopherbot
Copy link

Change https://golang.org/cl/320510 mentions this issue: go/token: correct the interval notation used in some panic messages

@griesemer
Copy link
Contributor

This is not a bug, I believe. The notation [a, b[ denotes the half-open interval [a, b).

@findleyr
Copy link
Contributor Author

This is not a bug, I believe. The notation [a, b[ denotes the half-open interval [a, b).

The interval in question is closed.

@findleyr findleyr changed the title go/token: typos in interval notation in panic messages go/token: incorrect interval in panic messages May 17, 2021
@golang golang locked and limited conversation to collaborators May 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants