Skip to content

x/vgo: vgo build and vgo mod -sync produce different list of dependencies #25971

Closed
@dlsniper

Description

@dlsniper

What version of Go are you using (go version)?

go version go1.10.3 linux/amd64
golang/vgo@f574d31

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

cross-platform issue

What did you do?

In the following case, having the files outside of GOPATH:

  • main.go
package main

import "github.com/gorilla/mux"

func main() {
	m := mux.NewRouter()
	_ = m
}
  • go.mod
module awesomevgoProject

Then run vgo build. Cleanup the go.mod file to the one in the issue and now run vgo mod -sync.

What did you expect to see?

  • vgo build produces the following go.mod
module awesomevgoProject

require github.com/gorilla/mux v1.6.2
  • vgo mod -sync produces the following go.mod
module awesomevgoProject

require (
	github.com/gorilla/context v1.1.1
	github.com/gorilla/mux v1.6.2
)

What did you see instead?

I expect the file to be similar in both cases.
And given that vgo build produces a working code, I expect that vgo build is the minimal source of truth in this case.

Maybe this works as expected but in this case, more documentation would be useful as vgo build will be significantly faster than vgo mod -sync in case of many dependencies that need to be downloaded if the pattern can replicate in larger projects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions