dominikh / go-tools

Staticcheck - The advanced Go linter
https://staticcheck.dev
MIT License
6.19k stars 377 forks source link

quickfix: suggest changing "break someLabel" with "break" when possible #240

Open mvdan opened 6 years ago

mvdan commented 6 years ago

This has happened a few times to me, such as when a switch was removed inside a for loop and the break labels stopped being necessary.

The check itself should be fairly simple - the question is to what extent would it be too pedantic. Perhaps labels can be used in long pieces of code to help readability, for example.

dominikh commented 6 years ago

I've recently found myself appreciating labels that weren't strictly necessary just because they improved readability. I don't think this check is worth the potential noise.