File tree 2 files changed +4
-4
lines changed
testdata/go1.0/CheckIfReturn
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -107,8 +107,8 @@ func run(pass *analysis.Pass) (any, error) {
107
107
return false
108
108
}
109
109
110
- // Don't flag if both are commented.
111
- if hasComments (n1 ) && hasComments (n2 ) {
110
+ // Don't flag if either branch is commented
111
+ if hasComments (n1 ) || hasComments (n2 ) {
112
112
return
113
113
}
114
114
Original file line number Diff line number Diff line change @@ -32,14 +32,14 @@ func cmt4(x string) bool {
32
32
}
33
33
34
34
func cmt5 (x string ) bool {
35
- if len (x ) > 0 { //@ diag(`should use 'return len(x) == 0'`)
35
+ if len (x ) > 0 {
36
36
return false
37
37
}
38
38
return true // A
39
39
}
40
40
41
41
func cmt6 (x string ) bool {
42
- if len (x ) > 0 { //@ diag(`should use 'return len(x) == 0'`)
42
+ if len (x ) > 0 {
43
43
return false // A
44
44
}
45
45
return true
You can’t perform that action at this time.
0 commit comments