-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: document the relationship between modules, repositories, and branches #27748
Comments
Why shouldn't it be included? I don't understand this issue. |
It seems a little wired that module ( Even though it's by design. The dependency version is incorrect. And once this module updates, need to bump the version in its own Thanks |
Ah, I understand what you mean now. This is because the module is now The v1 and v2 modules can be depended on simultaneously, and they will result in separate modules and packages. /cc @bcmills @myitcv in case the docs aren't clear enough on this. |
The closes thing in the Modules FAQ is https://github.com/golang/go/wiki/Modules#semantic-import-versioning. Perhaps it would be good to add a "my v2 module depends on the v1 version of itself" section, if this confusion is common. |
I see. Thanks for your explanation^^ |
Is it possible to remove the dependency on itself? I think it makes sense for another module to explicitly include |
No. An import path must have the same meaning throughout the program: as strange as it looks to use |
Got it. It seems no perfect solution. Thanks for your explanation. |
Please don't close this yet. I also lost a day before I could figure out the need to require the module that I am in the go.mod of the module itself, found it highly confusing at. This point should certainly be documented better everywhere. |
OK. I reopen it^^ |
I propose that we add the documentation tag to this issue and change the topic to "Document the need for modules to require themselves in certain cases". |
@beoran Did you figure out how to depend itself? I changed all the import path from |
I did find a way that works for me but it's with liberal use of |
Modules do not “require themselves”. |
Yes, but in ym case I had to add a require of the module itself plus a replace into the go.mod file to get the module to compile. I do work in an all-offline setting. I guess I am doing something wrong, but I don't know what, or how to do it correctly. By all means, please document this more. I guess the most bewildering part is that go modules are unlike anything I used in any other programming language before, not even like units in Pascal. |
@naTanDe wrote:
The discussion in this issue has been a bit nuanced, so sorry if my comment is off base. There are cases where it is indeed very desirable for module One question would be have you run After running |
At this point all of the information requested in the issue title is described in http://golang.org/wiki/Modules (thanks @thepudds!). Specifically, see: |
Please answer these questions before submitting your issue. Thanks!
What did you do?
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
What did you expect to see?
github.com/gopub/wine
shouldn't be included in go.modWhat did you see instead?
github.com/gopub/wine
is included in go.mod and the version is v1.0.5 (The highest version of wine is v2.0.1 though)System details
The text was updated successfully, but these errors were encountered: