Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1.5k
Add gobreakselectinfor linter#4924
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
ldez commentedAug 17, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
In order for a pull request adding a linter to be reviewed, the linter and the PR must follow some requirements.
Pull Request Description
Linter
The Linter Tests Inside Golangci-lint
|
Seems like your linter reports this even if you use labelled breaks which I think shouldn't be an issue when breaking in a package mainfuncbad() {varchchanstringOUTER:for {select {case<-ch:break OUTER } }} › go run ./cmd/go-break-select-in-for./home/simon/.../go-break-select-in-for/example.go:9:4:break statement insideselectstatement insidefor loopexit status 3 |
rnben commentedAug 17, 2024 • edited by ldez
Loading Uh oh!
There was an error while loading.Please reload this page.
edited by ldez
Uh oh!
There was an error while loading.Please reload this page.
Yes, you are right. I fixed in v0.0.2 funcbad(ch<-chanbool) {for {select {case<-ch:break// want "break statement inside select statement inside for loop"}}}funcgood(ch<-chanbool) {OUTER:for {select {case<-ch:break OUTER}}} › go run ./cmd/go-break-select-in-for./Users/ruben/workspaces/linter-demo/example.go:8:4:break statement insideselectstatement insidefor loopexit status 3 |
FYI https://semver.org/#how-should-i-deal-with-revisions-in-the-0yz-initial-development-phase |
rnben commentedAug 17, 2024 • edited by ldez
Loading Uh oh!
There was an error while loading.Please reload this page.
edited by ldez
Uh oh!
There was an error while loading.Please reload this page.
Should starting at 0.1.0 ? |
rnben commentedAug 19, 2024 • edited by ldez
Loading Uh oh!
There was an error while loading.Please reload this page.
edited by ldez
Uh oh!
There was an error while loading.Please reload this page.
Ok, I have updated, new version v0.1.0 |
CLAassistant commentedMay 20, 2025
|
Uh oh!
There was an error while loading.Please reload this page.
The Go lintergo-break-select-in-for checks that break statement inside select statement inside for loop.
For example, in myFunc the break may want to exit the outer for loop, but it doesn't work as expected.