-
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: go mod fails to find direct dependencies #28629
Comments
Is there a reason you did the Doing it at the top level directory works just fine:
I suspect the issue here in the case you report is that:
find a package Can you give details about what you were trying to achieve here? |
@myitcv Certainly! I was attempting to create an FWIW, I also tried |
@jadekler ah, I see. Yes, submodules (also known as multi-module repos, indeed submodules are a special instance of multi-module repos) are supported. Here's an example: https://github.com/go-modules-by-example/index/blob/master/009_submodules/README.md The sequencing of things is the slightly tough bit. But, I will just draw your attention to #27858 and #28136. The last time the question of splitting I'll leave this issue open however, because I think there is an outstanding issue that there should have been a more clear error in what you originally attempted. |
Thank you very much! This also needs to happen for cloud.google.com/go, so thanks for the tutorial link. re:oauth2; sounds like I should punt on that for now and go sync up with y'all that are already thinking about this. Will check in with Hana/Bryan about that. |
You're welcome. The advice at the moment is definitely to only create submodules/multi-module repos when you really need to. One indicator of being in that position is:
Would certainly be interested in hearing your feedback on submodules/multi-module repos here or over in #27858/#28136 so please keep us posted. |
Indeed. I believe that makes this a duplicate of #27063.
|
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?
What did you expect to see?
A go.mod file with,
And a populated go.sum.
What did you see instead?
And an empty go.sum.
Note: another weirdness is that when I run go.vendor, I get:
It found several dependencies, but it labeled them indirect. That's odd, because golang.org/x/oauth2/google directly depends on all of these. Furthermore,
go mod vendor
then goes on to stateno dependencies to vendor
immediately after it just vendored a bunch of things.The text was updated successfully, but these errors were encountered: