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 should not add a dependency to go.mod #28014

Closed
hyangah opened this issue Oct 4, 2018 · 2 comments
Closed

cmd/go: go list should not add a dependency to go.mod #28014

hyangah opened this issue Oct 4, 2018 · 2 comments

Comments

@hyangah
Copy link
Contributor

hyangah commented Oct 4, 2018

This is probably a duplicate of #27643. The thread got too long and I want to bring the attention to the go list command by filling this as a separate issue.

I was in a branch with a v2 module and this doesn't have a dependency on v0 or v1.

$ go list github.com/hyangah/foo/v2
github.com/hyangah/foo/v2 
$ cat go.mod
module github.com/hyangah/foo/v2

I queried the package in v1 by accident and found the go.mod was updated.

$ go list github.com/hyangah/foo
github.com/hyangah/foo
$ cat go.mod
module github.com/hyangah/foo/v2

require github.com/hyangah/foo v1.0.1 // indirect
@hyangah hyangah added the modules label Oct 4, 2018
@bcmills
Copy link
Contributor

bcmills commented Oct 4, 2018

This is probably a duplicate of #27643.

Yep, same general idea.

In the long term, I expect that most folks will want to have go mod tidy (or some wrapper around it) as a commit hook (see #27005).

@bcmills
Copy link
Contributor

bcmills commented Nov 29, 2018

This is probably a duplicate of #27643.

Actually, I think it's closer to #28692. (#27643 is about go get, which is a command that explicitly pulls in depedencies.)

@golang golang locked and limited conversation to collaborators Nov 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants