Currently we are getting panics sometimes running workspace/symbols due to a bug
in `go/doc`. golang/go#17788
This change prevents panics in our pkg collector goroutines taking the whole
server down. In the future we may want to have a better approach so we don't
accidently ignore panics, but for now this lets us move forward.
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.7.3 darwin/amd64
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
What did you do?
What did you expect to see?
No panic
What did you see instead?
A panic! The go file it is parsing is not valid go, but I don't expect to see a panic.
More context:
This only happens if you pass in
-u
. We noticed this error in production at Sourcegraph due to usingdoc.New
with theMode
set todoc.AllDecls
(see https://github.com/sourcegraph/go-langserver/blob/c9034820629b806e84f19677e0d2e71fd4ba8b56/langserver/symbol.go#L335 ). Production is a linux environment. I could reproduce it with thego doc
command, so reported it as such.The text was updated successfully, but these errors were encountered: