]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/mvs: indicate the actual version when printing a mismatched ModuleError
authorBryan C. Mills <bcmills@google.com>
Wed, 5 Aug 2020 03:53:01 +0000 (23:53 -0400)
committerBryan C. Mills <bcmills@google.com>
Mon, 24 Aug 2020 20:33:41 +0000 (20:33 +0000)
commitc777863f77bb77be2e6c336b78dee2089647ff0e
tree7aa4f5e8353da04d9c58507e0a77b88cf5919b31
parent6a718175a6b5532bb49160047731181a4ecec2a1
cmd/go/internal/mvs: indicate the actual version when printing a mismatched ModuleError

Previously, we suppressed the module version annotation if the last
error in the stack was a *module.ModuleError, regardless of its path.
However, if the error is for a replacement module, that produces a
confusing error message: the error is attributed to the last module in
the error path, but actually originates in the replacement (which is
not otherwise indicated).

Now, we print both the original and the replacement modules when they
differ, which may add some unfortunate redundancy in the output but at
least doesn't drop the very relevant information about replacements.

Fixes #35039

Change-Id: I631a7398033602b1bd5656150a4fad4945a87ade
Reviewed-on: https://go-review.googlesource.com/c/go/+/247765
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/cmd/go/internal/mvs/errors.go
src/cmd/go/testdata/script/mod_load_replace_mismatch.txt
src/cmd/go/testdata/script/mod_replace_gopkgin.txt