Skip to content

Commit d90dd54

Browse files
authored
Merge pull request #46 from kunwardeep/check-only-test-files
Run linter for test files only
2 parents 298e1f4 + 023e719 commit d90dd54

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/paralleltest/paralleltest.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,10 @@ func (a *parallelAnalyzer) run(pass *analysis.Pass) (interface{}, error) {
222222

223223
inspector.Preorder(nodeFilter, func(node ast.Node) {
224224
funcDecl := node.(*ast.FuncDecl)
225+
// Only process _test.go files
226+
if !strings.HasSuffix(pass.Fset.File(funcDecl.Pos()).Name(), "_test.go") {
227+
return
228+
}
225229
a.analyzeTestFunction(pass, funcDecl)
226230
})
227231

0 commit comments

Comments
 (0)