File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
testdata/go1.0/CheckIfReturn Expand file tree Collapse file tree 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) {
107107 return false
108108 }
109109
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 ) {
112112 return
113113 }
114114
Original file line number Diff line number Diff line change @@ -32,14 +32,14 @@ func cmt4(x string) bool {
3232}
3333
3434func cmt5 (x string ) bool {
35- if len (x ) > 0 { //@ diag(`should use 'return len(x) == 0'`)
35+ if len (x ) > 0 {
3636 return false
3737 }
3838 return true // A
3939}
4040
4141func cmt6 (x string ) bool {
42- if len (x ) > 0 { //@ diag(`should use 'return len(x) == 0'`)
42+ if len (x ) > 0 {
4343 return false // A
4444 }
4545 return true
You can’t perform that action at this time.
0 commit comments