Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: 'go mod download' fails with xyz+incompatible replacement targets while 'go mod verifies' works #34254

dmitris opened this issue Sep 12, 2019 · 1 comment


Copy link

commented Sep 12, 2019

What version of Go are you using (go version)?

go version go1.13 darwin/amd64

Does this issue reproduce with the latest release?


What operating system and processor architecture are you using (go env)?


What did you do?

my go.mod file contains replacement targets like: => v0.8.1+incompatible => v2.2.2+incompatible

I ran go mod verify and go mod download.

What did you expect to see?

Since the project used to build with go1.12 and still builds / tests run fine, I expect both commands to work without errors.

What did you see instead?

go mod verify shows all modules verified (as expected), but go mod download fails with:

$ go mod download
go: finding v0.8.1+incompatible
go: finding v2.2.2+incompatible invalid version: +incompatible suffix not allowed: major version v0 is compatible invalid version: +incompatible suffix not allowed: module contains a go.mod file, so semantic import versioning is required

This seems related to #34217; on slack @bcmills said that it is likely a bug.

would argue that the acceptable versions should be: => v2.2.2
(because […]/v2 should be able to replace[…].v2, bug notwithstanding) or => v2.2.2
(because the go.mod file should say explicitly, and that should be good enough for validation).


This comment has been minimized.

Copy link

commented Sep 12, 2019

To clarify, the symptom you saw that I think is clearly a bug is the one when using

replace => v2.2.2

which you reported to produce the error:

go: go.mod has non-.../v2 module path "" (and .../v2/go.mod does not exist) at revision v2.2.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.