cmd/go: "index out of range" panic with "list -e" involving multiple packages #59905
Labels
GoCommand
cmd/go
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
No, this panic does not happen with Go 1.20.3.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I was writing a test for a tool of mine, and ran into a
go list
panic. I minimized it as follows, which can be run with https://pkg.go.dev/github.com/rogpeppe/go-internal/cmd/testscript:What did you expect to see?
Note that the input Go packages are broken due to copy-paste mistakes of mine. You can see the valid errors if you use
go run
instead:What did you see instead?
I guess there's no guarantee that ImportStack is non-empty?
FYI @matloob, as the code was recently added in https://go-review.googlesource.com/c/go/+/483515.
The text was updated successfully, but these errors were encountered: