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

Comments

@FireFart
Copy link

@FireFart FireFart commented Feb 24, 2021

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
@ianlancetaylor ianlancetaylor added this to Incoming in Proposals Feb 24, 2021
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Feb 24, 2021

Dup of #16520.

@ianlancetaylor ianlancetaylor removed this from Incoming in Proposals Mar 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants