powerwalk icon indicating copy to clipboard operation
powerwalk copied to clipboard

panic if multiple files error out at once

Open stelcheck opened this issue 8 years ago • 0 comments

It appears that if I have multiple functions running in parallel returning a non-nil error, this will happen.

panic: close of closed channel

goroutine 142 [running]:
panic(0x7d2440, 0xc042344460)
        /usr/local/go/src/runtime/panic.go:500 +0x1af
github.com/stretchr/powerwalk.WalkLimit.func2(0xc042339ca0, 0xc04232c660, 0xc04232c600)
        /go/src/github.com/stretchr/powerwalk/walker.go:76 +0xe4
created by github.com/stretchr/powerwalk.WalkLimit
        /go/src/github.com/stretchr/powerwalk/walker.go:80 +0x1b5

My guess is that we should check if the channel has been closed before closing it.

stelcheck avatar Mar 11 '17 07:03 stelcheck