File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed
pkg/golinters/goanalysis/checker Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 55
66fast_build : FORCE
77 go build -o golangci-lint ./cmd/golangci-lint
8+ build_race : FORCE
9+ go build -race -o golangci-lint ./cmd/golangci-lint
810build : golangci-lint
911clean :
1012 rm -f golangci-lint test/path
1113 rm -rf tools
12- .PHONY : fast_build build clean
14+ .PHONY : fast_build build build_race clean
1315
1416# Test
1517
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import (
1919 "os"
2020 "reflect"
2121 "runtime"
22+ "runtime/debug"
2223 "runtime/pprof"
2324 "runtime/trace"
2425 "sort"
@@ -285,11 +286,17 @@ func (act *action) String() string {
285286func execAll (actions []* action ) {
286287 sequential := dbg ('p' )
287288 var wg sync.WaitGroup
288- for _ , act := range actions {
289+ panics := make ([]interface {}, len (actions ))
290+ for i , act := range actions {
289291 wg .Add (1 )
290292 work := func (act * action ) {
293+ defer func () {
294+ wg .Done ()
295+ if p := recover (); p != nil {
296+ panics [i ] = fmt .Errorf ("%s: %s" , p , debug .Stack ())
297+ }
298+ }()
291299 act .exec ()
292- wg .Done ()
293300 }
294301 if sequential {
295302 work (act )
@@ -298,6 +305,11 @@ func execAll(actions []*action) {
298305 }
299306 }
300307 wg .Wait ()
308+ for _ , p := range panics {
309+ if p != nil {
310+ panic (p )
311+ }
312+ }
301313}
302314
303315func (act * action ) exec () { act .once .Do (act .execOnce ) }
You can’t perform that action at this time.
0 commit comments