Skip to content

Commit

Permalink
fix #8, fix #16: fix parallel writes to runner
Browse files Browse the repository at this point in the history
runner.run is called in parallel by go/analysis
therefore we need to handle parallel writes to the runner
  • Loading branch information
jirfag committed Jul 14, 2019
1 parent d96ec0d commit 65da191
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion passes/bodyclose/bodyclose.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ type runner struct {
skipFile map[*ast.File]bool
}

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

Expand Down

0 comments on commit 65da191

Please sign in to comment.