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

x/website: Effective go docs say there are 3 forms of for but with for .. range there are 4 #57545

Closed
damonfeldman opened this issue Jan 2, 2023 · 1 comment

Comments

@damonfeldman
Copy link

What is the URL of the page with the issue?

https://go.dev/doc/effective_go

What is your user agent?

Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:108.0) Gecko/20100101 Firefox/108.0

Screenshot

image

What did you expect to see?

I expected the
for key, value := range
form of a for loop to conform to one of the three for loop forms listed above, since the doc says there are only three forms.

What did you see instead?

Three forms listed, then immediate use of the fourth (for..range) form.

@gopherbot gopherbot added this to the Unreleased milestone Jan 2, 2023
@seankhliao
Copy link
Member

key, value := range oldMap is a single condition in the second form.

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Jan 2, 2023
@golang golang locked and limited conversation to collaborators Jan 2, 2024
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