]> Cypherpunks repositories - gostls13.git/commit
cmd/go: don't assume ImportStack always set on PackageError
authorMichael Matloob <matloob@golang.org>
Thu, 8 Jun 2023 20:20:17 +0000 (16:20 -0400)
committerMichael Matloob <matloob@golang.org>
Fri, 9 Jun 2023 22:48:58 +0000 (22:48 +0000)
commit82dc37c0d05c33c00b585664cba1c647bf8ac99e
treef410b1d5a884bd5dfee551bd832b0948e425d371
parent5e9b76fe2a1c6709e710c985ae82dff90c847c54
cmd/go: don't assume ImportStack always set on PackageError

When determining DepsErrors for packages, we were trying to sort
errors by the top package on their ImportStack (which would likely be
the package the error was generated for) to get a deterministic
error order.

The problem is that some PackageErrors don't have ImportStacks set on
them. Fall back to sorting the errors by the error text (instead of
making things more complicated by tracking the packages that produced
the errors more closely).

Fixes #59905

Change-Id: Id305e1e70801f8909fd6463383b8eda193559787
Reviewed-on: https://go-review.googlesource.com/c/go/+/501978
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
src/cmd/go/internal/list/list.go
src/cmd/go/testdata/script/list_issue_59905.txt [new file with mode: 0644]