-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: allow <meta> tags to override version tag prefixes for submodules #26664
Comments
CC @bcmills |
This is working as designed: see the “Multiple-Module Repositories” section of https://research.swtch.com/vgo-module. The Perhaps we could fall back to versions without a prefix if there are no versions tagged with the prefix, but then what happens if a prefixed tag is added later? If you added the tag |
Your use-case is interesting, though: you're using a I'll leave that for @rsc to decide. |
Sorry, but this is working as intended. I understand why you'd want to do that, but part of the design here is to allow a single repo to contain modules at different versions. If the repo corresponds to cirello.io (as in this case), then to tag a specific version of cirello.io/errors as v1.1.8, you need to create an errors/v1.1.8 tag. And because there is an errors/go.mod file, the module cirello.io does not contain that directory. Modules do not contain other modules. For all but power users, you probably want to adopt the usual convention that one repo = one module. It's important for long-term evolution of code storage options that a repo can contain multiple modules, but it's almost certainly not something you want to do by default. We will be writing a doc at some point about how and how not to arrange multiple modules in a single repo. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.10.3 linux/amd64 vgo:devel +88c76dcbab
go version go1.11beta2 darwin/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?What did you do?
Reproduction script:
https://github.com/ucirello/gomod-submod-bug/blob/master/test.sh
Log at:
https://github.com/ucirello/gomod-submod-bug/blob/master/test.log
What did you expect to see?
When running
go get
, I expected to seecirello.io/errors@v1.1.8
to be imported instead of v0 placeholder.When manually changing
go.mod
torequire cirello.io v1.1.8
, I would expect modules system to pullcirello.io@v1.1.8
and extractcirello.io/errors
from it.What did you see instead?
The builder breaks.
The text was updated successfully, but these errors were encountered: