-
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
x/vgo: mod -sync does not list direct dependency of dependency but lists dependency of the dependency of the direct dependency #26215
Comments
This should get much less confusing after https://golang.org/cl/121304 lands. |
It's not just about being confusing. The problem is that tools need to be able to retrieve the list of all modules/packages needed in order to create the complete environment for users. As an example of where this would be needed, here's how the GoLand integration for vgo works, and what users expect that the IDE will display for them: https://youtrack.jetbrains.com/issue/GO-5865#focus=streamItem-27-2935718-0-0 Should we use |
Yes, tools should use |
Here's another case then, at least in the current implementation. With the following content in
Running {
"Path": "vgoawesomeProject",
"Main": true
} Running {
"Path": "vgoawesomeProject",
"Main": true
}
{
"Path": "github.com/dlsniper/vgodemo",
"Version": "v1.0.0",
"Replace": {
"Path": "github.com/dlsniper/vgodemo",
"Version": "v0.0.0-20180704102233-4356961a96dc",
"Time": "2018-07-04T10:22:33Z",
"Dir": "D:\\go\\src\\mod\\github.com\\dlsniper\\[email protected]"
},
"Time": "2018-07-04T10:22:33Z",
"Dir": "D:\\go\\src\\mod\\github.com\\dlsniper\\[email protected]"
}
{
"Path": "github.com/gorilla/mux",
"Version": "v1.6.2",
"Time": "2018-05-13T03:22:33Z",
"Dir": "D:\\go\\src\\mod\\github.com\\gorilla\\[email protected]"
} However, in this output there is no |
There is no There is a |
Yes, the confusion is because gorilla/mux v1.6.2 is not providing its own dependencies, so your go.mod file is doing it instead. It looks like the next gorilla/mux will have a go.mod and hopefully one with context listed as a dep. And then your project won't have to supply it instead. As Bryan noted, soon that line will say As Bryan also noted, unless you're writing a go.mod editor, you should use "go list -json -m all" instead of "go mod -json". |
What version of Go are you using (
go version
)?vgo @ 6cd5a417451d8ee907692eded07ef1b6b53825b1
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?Windows 10/amd64
What did you do?
vgo mod -sync
What did you expect to see?
The following contents in
go.mod
or at least, if I understand the description of
mod -sync
correctly.What did you see instead?
I don't understand how come
context
is listed there but notmux
itself?vgo build
seems to at least list justvgodemo
as dependency and notcontext
which is more in line with what I would expect given our previous conversation in #25971.Thank you.
The text was updated successfully, but these errors were encountered: