-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
cmd/vet: warn on 3-clause loops where an iterator variable contains a lock type when GoVersion>=1.22 #66387
Comments
Proposed implementation http://go.dev/cl/569955. Related #66156. This is 'Case 1'. |
Change https://go.dev/cl/569955 mentions this issue: |
This proposal has been added to the active column of the proposals project |
This proposal has been added to the active column of the proposals project |
Based on the discussion above, this proposal seems like a likely accept. The proposal details are in #66387 (comment). |
No change in consensus, so accepted. 🎉 The proposal details are in #66387 (comment). |
Will this be merged to the main repo some day? |
This is expected to go into tip during the next x/tools. Probably not more than a month. The first release it is expected to go into is 1.24. |
This vet change seems like something that needs to be mentioned in Go 1.24 release notes, and it's not mentioned there yet. Reopening as a release blocker to track that. |
Change https://go.dev/cl/632315 mentions this issue: |
Proposal Details
Extend the
copylock
analyzer to emit a warning on the copy of the loop variable between iterations that occurs immediately before the loop's Post statement in Go >= 1.22. The requirements for the warning are when:_
, andExample:
Relevant part of the spec https://go.dev/ref/spec#For_clause :
The text was updated successfully, but these errors were encountered: