{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/34383","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/34383/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/34383/comments","events_url":"https://api.github.com/repos/golang/go/issues/34383/events","html_url":"https://github.com/golang/go/issues/34383","id":495507468,"node_id":"MDU6SXNzdWU0OTU1MDc0Njg=","number":34383,"title":"cmd/go: 'go get […]/v2@v2.X.Y' fails when the go.mod file for […]/v2 is at the repo root","user":{"login":"abraithwaite","id":3791413,"node_id":"MDQ6VXNlcjM3OTE0MTM=","avatar_url":"https://avatars0.githubusercontent.com/u/3791413?v=4","gravatar_id":"","url":"https://api.github.com/users/abraithwaite","html_url":"https://github.com/abraithwaite","followers_url":"https://api.github.com/users/abraithwaite/followers","following_url":"https://api.github.com/users/abraithwaite/following{/other_user}","gists_url":"https://api.github.com/users/abraithwaite/gists{/gist_id}","starred_url":"https://api.github.com/users/abraithwaite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abraithwaite/subscriptions","organizations_url":"https://api.github.com/users/abraithwaite/orgs","repos_url":"https://api.github.com/users/abraithwaite/repos","events_url":"https://api.github.com/users/abraithwaite/events{/privacy}","received_events_url":"https://api.github.com/users/abraithwaite/received_events","type":"User","site_admin":false},"labels":[{"id":503763046,"node_id":"MDU6TGFiZWw1MDM3NjMwNDY=","url":"https://api.github.com/repos/golang/go/labels/GoCommand","name":"GoCommand","color":"006b75","default":false},{"id":373402289,"node_id":"MDU6TGFiZWwzNzM0MDIyODk=","url":"https://api.github.com/repos/golang/go/labels/NeedsInvestigation","name":"NeedsInvestigation","color":"ededed","default":false},{"id":992189327,"node_id":"MDU6TGFiZWw5OTIxODkzMjc=","url":"https://api.github.com/repos/golang/go/labels/modules","name":"modules","color":"bac2ff","default":false}],"state":"closed","locked":false,"assignee":{"login":"bcmills","id":5200974,"node_id":"MDQ6VXNlcjUyMDA5NzQ=","avatar_url":"https://avatars3.githubusercontent.com/u/5200974?v=4","gravatar_id":"","url":"https://api.github.com/users/bcmills","html_url":"https://github.com/bcmills","followers_url":"https://api.github.com/users/bcmills/followers","following_url":"https://api.github.com/users/bcmills/following{/other_user}","gists_url":"https://api.github.com/users/bcmills/gists{/gist_id}","starred_url":"https://api.github.com/users/bcmills/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcmills/subscriptions","organizations_url":"https://api.github.com/users/bcmills/orgs","repos_url":"https://api.github.com/users/bcmills/repos","events_url":"https://api.github.com/users/bcmills/events{/privacy}","received_events_url":"https://api.github.com/users/bcmills/received_events","type":"User","site_admin":false},"assignees":[{"login":"bcmills","id":5200974,"node_id":"MDQ6VXNlcjUyMDA5NzQ=","avatar_url":"https://avatars3.githubusercontent.com/u/5200974?v=4","gravatar_id":"","url":"https://api.github.com/users/bcmills","html_url":"https://github.com/bcmills","followers_url":"https://api.github.com/users/bcmills/followers","following_url":"https://api.github.com/users/bcmills/following{/other_user}","gists_url":"https://api.github.com/users/bcmills/gists{/gist_id}","starred_url":"https://api.github.com/users/bcmills/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcmills/subscriptions","organizations_url":"https://api.github.com/users/bcmills/orgs","repos_url":"https://api.github.com/users/bcmills/repos","events_url":"https://api.github.com/users/bcmills/events{/privacy}","received_events_url":"https://api.github.com/users/bcmills/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/95","html_url":"https://github.com/golang/go/milestone/95","labels_url":"https://api.github.com/repos/golang/go/milestones/95/labels","id":4185562,"node_id":"MDk6TWlsZXN0b25lNDE4NTU2Mg==","number":95,"title":"Go1.14","description":"","creator":{"login":"andybons","id":365204,"node_id":"MDQ6VXNlcjM2NTIwNA==","avatar_url":"https://avatars3.githubusercontent.com/u/365204?v=4","gravatar_id":"","url":"https://api.github.com/users/andybons","html_url":"https://github.com/andybons","followers_url":"https://api.github.com/users/andybons/followers","following_url":"https://api.github.com/users/andybons/following{/other_user}","gists_url":"https://api.github.com/users/andybons/gists{/gist_id}","starred_url":"https://api.github.com/users/andybons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andybons/subscriptions","organizations_url":"https://api.github.com/users/andybons/orgs","repos_url":"https://api.github.com/users/andybons/repos","events_url":"https://api.github.com/users/andybons/events{/privacy}","received_events_url":"https://api.github.com/users/andybons/received_events","type":"User","site_admin":false},"open_issues":1018,"closed_issues":199,"state":"open","created_at":"2019-03-30T21:11:32Z","updated_at":"2019-09-25T19:50:56Z","due_on":"2020-02-01T08:00:00Z","closed_at":null},"comments":12,"created_at":"2019-09-18T23:58:54Z","updated_at":"2019-09-25T19:50:56Z","closed_at":"2019-09-25T19:50:56Z","author_association":"CONTRIBUTOR","body":"<!-- Please answer these questions before submitting your issue. Thanks! -->\r\n\r\n### What version of Go are you using (`go version`)?\r\n\r\n<pre>\r\n$ go version\r\ngo version go1.13 linux/amd64\r\n</pre>\r\n\r\n### Does this issue reproduce with the latest release?\r\n\r\nYes\r\n\r\n\r\n### What operating system and processor architecture are you using (`go env`)?\r\n\r\n<details><summary><code>go env</code> Output</summary><br><pre>\r\n$ go env\r\nGO111MODULE=\"on\"\r\nGOARCH=\"amd64\"\r\nGOBIN=\"\"\r\nGOCACHE=\"/home/abraithwaite/.cache/go-build\"\r\nGOENV=\"/home/abraithwaite/.config/go/env\"\r\nGOEXE=\"\"\r\nGOFLAGS=\"\"\r\nGOHOSTARCH=\"amd64\"\r\nGOHOSTOS=\"linux\"\r\nGONOPROXY=\"\"\r\nGONOSUMDB=\"\"\r\nGOOS=\"linux\"\r\nGOPATH=\"/home/abraithwaite/Projects/golang\"\r\nGOPRIVATE=\"\"\r\nGOPROXY=\"direct\"\r\nGOROOT=\"/usr/lib/go\"\r\nGOSUMDB=\"sum.golang.org\"\r\nGOTMPDIR=\"\"\r\nGOTOOLDIR=\"/usr/lib/go/pkg/tool/linux_amd64\"\r\nGCCGO=\"gccgo\"\r\nAR=\"ar\"\r\nCC=\"gcc\"\r\nCXX=\"g++\"\r\nCGO_ENABLED=\"1\"\r\nGOMOD=\"/dev/null\"\r\nCGO_CFLAGS=\"-g -O2\"\r\nCGO_CPPFLAGS=\"\"\r\nCGO_CXXFLAGS=\"-g -O2\"\r\nCGO_FFLAGS=\"-g -O2\"\r\nCGO_LDFLAGS=\"-g -O2\"\r\nPKG_CONFIG=\"pkg-config\"\r\nGOGCCFLAGS=\"-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build983177457=/tmp/go-build -gno-record-gcc-switches\"\r\n</pre></details>\r\n\r\n### What did you do?\r\n\r\n<!--\r\nIf possible, provide a recipe for reproducing the error.\r\nA complete runnable program is good.\r\nA link on play.golang.org is best.\r\n-->\r\n\r\nWe were upgrading a library (`github.com/segmentio/events`) to match proper major version module semantics (we already had some v2 release tags from before modules), and we kept running into the following when trying to `go get` the module.\r\n\r\n```\r\nGO111MODULE=on GOPROXY=direct go get -u github.com/segmentio/events/v2@v2.3.2\r\ngo: finding github.com/segmentio/events v2.3.2\r\ngo get github.com/segmentio/events/v2@v2.3.2: github.com/segmentio/events@v2.3.2: invalid version: module contains a go.mod file, so major version must be compatible: should be v0 or v1, not v2\r\n```\r\n\r\n### What did you expect to see?\r\n\r\nWe expected to see the module fetched without an error.\r\n\r\n### What did you see instead?\r\n\r\n```\r\nGO111MODULE=on GOPROXY=direct go get -u github.com/segmentio/events/v2@v2.3.2\r\ngo: finding github.com/segmentio/events v2.3.2\r\ngo get github.com/segmentio/events/v2@v2.3.2: github.com/segmentio/events@v2.3.2: invalid version: module contains a go.mod file, so major version must be compatible: should be v0 or v1, not v2\r\n```\r\n\r\nWe're aware that the other v2 tags are invalid: that is they don't have a correct go.mod file.\r\n\r\nWhen we remove the `v2` branch from the repository, `go get` works again without issues.  We're skipping the module proxy and doing this with a clean modules cache.  We expect that the error is a bit more clear at the very least.  At the best, it ignores the `v2` branch entirely and just uses the tag specified.\r\n\r\nWe're leaving the `v2` branch in tact for now so that others can test and debug this issue.\r\n\r\nAlso interestingly, doing `go get` without specifying the exact tag works fine:\r\n\r\n```\r\n16:58:46 $ GO111MODULE=on GOPROXY=direct go get -u github.com/segmentio/events/v2\r\ngo: finding golang.org/x/sys latest\r\n16:59:14 $ cat go.mod\r\nmodule github.com/segmentio/blah\r\n\r\ngo 1.13\r\n\r\nrequire github.com/segmentio/events/v2 v2.3.2 // indirect\r\n```"},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/535183887","html_url":"https://github.com/golang/go/issues/34383#issuecomment-535183887","issue_url":"https://api.github.com/repos/golang/go/issues/34383","id":535183887,"node_id":"MDEyOklzc3VlQ29tbWVudDUzNTE4Mzg4Nw==","user":{"login":"bcmills","id":5200974,"node_id":"MDQ6VXNlcjUyMDA5NzQ=","avatar_url":"https://avatars3.githubusercontent.com/u/5200974?v=4","gravatar_id":"","url":"https://api.github.com/users/bcmills","html_url":"https://github.com/bcmills","followers_url":"https://api.github.com/users/bcmills/followers","following_url":"https://api.github.com/users/bcmills/following{/other_user}","gists_url":"https://api.github.com/users/bcmills/gists{/gist_id}","starred_url":"https://api.github.com/users/bcmills/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcmills/subscriptions","organizations_url":"https://api.github.com/users/bcmills/orgs","repos_url":"https://api.github.com/users/bcmills/repos","events_url":"https://api.github.com/users/bcmills/events{/privacy}","received_events_url":"https://api.github.com/users/bcmills/received_events","type":"User","site_admin":false},"created_at":"2019-09-25T19:50:56Z","updated_at":"2019-09-25T19:50:56Z","author_association":"MEMBER","body":"This should be working using `gotip`, and with `go1.13.2` whenever that is released. (Note that `go1.13.1` is a security-only release and thus will not contain the fix for this non-security issue.)"}}
{"actor":{"display_login":"bcmills"}}