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

Slice syntax in documentation wrong #14477

Closed
jarro2783 opened this issue Feb 23, 2016 · 3 comments
Closed

Slice syntax in documentation wrong #14477

jarro2783 opened this issue Feb 23, 2016 · 3 comments
Milestone

Comments

@jarro2783
Copy link

The syntax for a slice given in the documentation is wrong.

https://golang.org/ref/spec#Primary_expressions

Slice          = "[" ( [ Expression ] ":" [ Expression ] ) |
                     ( [ Expression ] ":" Expression ":" Expression )

The inner parens are unnecessary, but the whole alternate inside the [ ] needs parens since sequences have higher precedence than alternatives.

@minux
Copy link
Member

minux commented Feb 23, 2016 via email

@griesemer griesemer self-assigned this Feb 23, 2016
@griesemer griesemer added this to the Go1.7 milestone Feb 23, 2016
@griesemer
Copy link
Contributor

Indeed! Thanks for pointing this out. Amazing how many eyes must have missed this. Fix forthcoming.

@gopherbot
Copy link
Contributor

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

@golang golang locked and limited conversation to collaborators Feb 28, 2017
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

4 participants