We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent de48f96 commit e65b392Copy full SHA for e65b392
simple/s1008/s1008.go
@@ -107,8 +107,8 @@ func run(pass *analysis.Pass) (any, error) {
107
return false
108
}
109
110
- // Don't flag if both are commented.
111
- if hasComments(n1) && hasComments(n2) {
+ // Don't flag if either branch is commented
+ if hasComments(n1) || hasComments(n2) {
112
return
113
114
simple/s1008/testdata/go1.0/CheckIfReturn/comment.go
@@ -32,14 +32,14 @@ func cmt4(x string) bool {
32
33
34
func cmt5(x string) bool {
35
- if len(x) > 0 { //@ diag(`should use 'return len(x) == 0'`)
+ if len(x) > 0 {
36
37
38
return true // A
39
40
41
func cmt6(x string) bool {
42
43
return false // A
44
45
return true
0 commit comments