cmd/go: unable to get major versions/sub modules when using vanity urls #58654
Labels
GoCommand
cmd/go
modules
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
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?
I have a small package set up at https://github.com/tomasruud/gvm for reproducing this issue. This package is set up with vanity urls, by using Github pages as hosting. The root of the package has module name
tomasruud.github.io/gvm
, which is linked up with Github pages, so when you try to get https://tomasruud.github.io/gvm you'll be served an html page with thego-import
set to point to the Github repository.This works fine for major version v0 and v1, but once I try to add a
v2
module in my project, go mod seems to be unable to find thetomasruud.github.io/gvm/v2
module. I have added v2 as a submodule by following the documentation, so the code lives in a v2 folder under the root of the project, with its own go.mod file.The same issue happens with other submodules in the project. I have tried adding a
foo
module and tagging it accordingly, but go mod seems unable to find this module also.What did you expect to see?
I would expect go mod to be able to resolve the submodules based on the tags and subfolder from the repository.
What did you see instead?
Instead I'm getting errors like these
$ go get tomasruud.github.io/gvm/v2@v2.0.0 go: tomasruud.github.io/gvm@v2.0.0: invalid version: module contains a go.mod file, so module path must match major version ("tomasruud.github.io/gvm/v2")
The text was updated successfully, but these errors were encountered: