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

proposal: cmd/vet: check for iterator variable reference #44587

Closed
firefart opened this issue Feb 24, 2021 · 1 comment
Closed

proposal: cmd/vet: check for iterator variable reference #44587

firefart opened this issue Feb 24, 2021 · 1 comment
Labels
Analysis Issues related to static analysis (vet, x/tools/go/analysis) FrozenDueToAge Proposal
Milestone

Comments

@firefart
Copy link

Hi,
I wanted to make a feature request as this happens way too often and results in strange errors which are hard to debug: The iterator variable reference (https://github.com/golang/go/wiki/CommonMistakes#using-reference-to-loop-iterator-variable) should be reported by go vet.

I think this would increase code quality a lot if those errors could be reported by analyzing the code.

@seankhliao seankhliao changed the title Feature Request: go vet should check for iterator variable reference cmd/vet: check for iterator variable reference Feb 24, 2021
@seankhliao seankhliao changed the title cmd/vet: check for iterator variable reference proposal: cmd/vet: check for iterator variable reference Feb 24, 2021
@gopherbot gopherbot added this to the Proposal milestone Feb 24, 2021
@seankhliao seankhliao added the Analysis Issues related to static analysis (vet, x/tools/go/analysis) label Feb 24, 2021
@ianlancetaylor ianlancetaylor added this to Incoming in Proposals (old) Feb 24, 2021
@ianlancetaylor
Copy link
Contributor

Dup of #16520.

@ianlancetaylor ianlancetaylor removed this from Incoming in Proposals (old) Mar 22, 2021
@golang golang locked and limited conversation to collaborators Feb 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Analysis Issues related to static analysis (vet, x/tools/go/analysis) FrozenDueToAge Proposal
Projects
None yet
Development

No branches or pull requests

4 participants