Skip to content
This repository was archived by the owner on Jun 2, 2023. It is now read-only.

Commit 87058b9

Browse files
authored
Merge pull request timakin#17 from golangci/master
fix timakin#8, fix timakin#16: fix parallel writes to runner
2 parents d96ec0d + 65da191 commit 87058b9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

passes/bodyclose/bodyclose.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ type runner struct {
3838
skipFile map[*ast.File]bool
3939
}
4040

41-
func (r *runner) run(pass *analysis.Pass) (interface{}, error) {
41+
// run executes an analysis for the pass. The receiver is passed
42+
// by value because this func is called in parallel for different passes.
43+
func (r runner) run(pass *analysis.Pass) (interface{}, error) {
4244
r.pass = pass
4345
funcs := pass.ResultOf[buildssa.Analyzer].(*buildssa.SSA).SrcFuncs
4446

0 commit comments

Comments
 (0)