cmd/go: mod verify tries to download replaced dependency #49118
Labels
GoCommand
cmd/go
modules
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?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
We have the following two files.
Attempting to execute
go run main.go
results in an error.Running
go mod download rsc.io/quote
and thengo run main.go
again gives another error:Executing
go get quote_alias
fails with the error:The
go.mod
file is clearly malformed, but can be fixed by runninggo mod tidy
. The result is as follows:Now
go run main.go
works as expected. However,go mod verify
fails with the following message:What did you expect to see?
I expected
go mod tidy
to fix thego.mod
file (which it did) and forgo mod verify
to accept the result.What did you see instead?
The
go mod verify
command treated the requirement with a placeholder ZeroPseudoVersion as a real package, attempted to look for it and failed.Shouldn't
go mod verify
ignore ZeroPseudoVersion-ed requirements on principle? After all, a ZPV is a synthetic placeholder, not a real version string. If the discussion here reaches this conclusion, I may already have a fix and a regression test ready for review.The text was updated successfully, but these errors were encountered: