Skip to content
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 list -m' should be deterministic #28019

hyangah opened this issue Oct 4, 2018 · 1 comment


None yet
2 participants
Copy link

commented Oct 4, 2018

Unlike the package-based query (go list)
that would behave like go get underneath (#28014, #27643),
go list -m operates only with the modules already in the cache.
That makes the result stateful, often confusing.

For example,

# the module is not in our module cache yet.
$ go list -u --versions -m
go list -m module "" is not a known dependency

# package-level query.
$ go list
go: finding v1.0.0
go: downloading v1.0.0

# now, let's run the same query.
$ go list -u --versions -m v1.0.0

@hyangah hyangah added the modules label Oct 4, 2018

@bcmills bcmills added this to the Go1.13 milestone Nov 19, 2018


This comment has been minimized.

Copy link

commented Nov 19, 2018

I think the underlying use-case is mostly addressed by the fix for #24250: every set of flags that works outside a module should also work inside a module, and go list -m -versions should pretty clearly work everywhere.

That said, go list -m is already deterministic: unless you provide a specific version (or the -versions flag) it restricts its answer to the modules active in the build list, and that set of modules is a deterministic function of the go.mod file.

@bcmills bcmills closed this Nov 19, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.