Skip to content

Commit 7d1cc12

Browse files
authored
Merge pull request #55 from kunwardeep/fix-false-positive-remove-redundant-check
remove redundant check
2 parents a73b878 + bf759bb commit 7d1cc12

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

pkg/paralleltest/paralleltest.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,6 @@ func (a *parallelAnalyzer) checkBuilderFunctionForParallel(pass *analysis.Pass,
264264
// Found the builder function, analyze it and return immediately
265265
hasParallel := false
266266
ast.Inspect(funcDecl, func(n ast.Node) bool {
267-
if hasParallel {
268-
return false
269-
}
270-
271267
// Look for return statements
272268
returnStmt, ok := n.(*ast.ReturnStmt)
273269
if !ok || len(returnStmt.Results) == 0 {
@@ -296,14 +292,15 @@ func (a *parallelAnalyzer) checkBuilderFunctionForParallel(pass *analysis.Pass,
296292
return true
297293
})
298294

299-
// Exit immediately if we found t.Parallel()
295+
// Exit inspection immediately if we found t.Parallel()
300296
if hasParallel {
301297
return false
302298
}
303299
}
304300
}
305301
}
306-
return !hasParallel // Stop inspection if we found t.Parallel()
302+
// Continue to next return statement if t.Parallel() not found yet
303+
return true
307304
})
308305

309306
// Return immediately after processing the matching function

0 commit comments

Comments
 (0)