]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/modload: don't report path errors when loading retractions
authorJay Conrod <jayconrod@google.com>
Fri, 18 Sep 2020 15:48:18 +0000 (11:48 -0400)
committerJay Conrod <jayconrod@google.com>
Fri, 18 Sep 2020 16:07:01 +0000 (16:07 +0000)
commit0b71ce6768acd33f188e3edfdc40046c7f6ddf57
treec7148ff296b2b203f4511f7e4d540d3088b1f0c8
parent789d77a87e5417c10377a9f9de07ec37c65048f2
cmd/go/internal/modload: don't report path errors when loading retractions

When we load module retractions from the latest version of a module,
it's possible that the latest version has a different module path than
the version we're loading. This can happen when a module is renamed or
a go.mod file is added for the first time.

We should not report an error in this case. Retractions should still
apply to old aliases of a module.

Fixes #41350

Change-Id: If1bc0b6b2b26fc7023e02fc211aa0cd8eb00796e
Reviewed-on: https://go-review.googlesource.com/c/go/+/255961
Trust: Jay Conrod <jayconrod@google.com>
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
src/cmd/go/internal/modload/modfile.go
src/cmd/go/testdata/mod/example.com_retract_rename_v1.0.0-bad.txt [new file with mode: 0644]
src/cmd/go/testdata/mod/example.com_retract_rename_v1.9.0-new.txt [new file with mode: 0644]
src/cmd/go/testdata/script/mod_retract_rename.txt [new file with mode: 0644]