You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes it makes sense to have code organised this way:
if cond {
// explain a rather non-obvious condition checked by this if()
return true
}
// I expect more cases to appear where I need to return true,
// but for now the above case is the only one.
return false
Gosimple's check S1008 suggests to replace this with a plain return cond.
If a conditional if smth { return true } has comments inside, then do not suggest to fold it with the code that follows.
The text was updated successfully, but these errors were encountered:
To have the linter assume that when there are comments in place it's "OK", you already add comments. Adding a prefix to be more explicit about it instead of assuming sounds much more robust to me. Plus it allows you to find it in the future, something you've already planned for.
Sometimes it makes sense to have code organised this way:
Gosimple's check S1008 suggests to replace this with a plain
return cond
.If a conditional
if smth { return true }
has comments inside, then do not suggest to fold it with the code that follows.The text was updated successfully, but these errors were encountered: