-
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: mod tidy adds indirect test dependencies #29323
Comments
go mod tidy
unreasonably adds indirect test dependencies
Duplicate of #27633 ? |
See previous discussion in #26626.
That's debatable:
That's #25873. (In general, please stick to one decision per issue filed: when we close an issue — especially if it turns out to be a duplicate! — it's easy to miss an interesting secondary point.) |
Closing as a duplicate of the aforementioned issues. |
go mod tidy
often adds dependencies which will never get used, such as indirect test dependencies (test-related dependencies of dependencies), or dependencies via likely-to-be-unused build tags (such as gopherjs dependencies for projects that support thejs
build tag.This issue is compounded when followed by
go mod vendor
, which includes these dependencies as well.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?
$ go mod tidy
What did you expect to see?
What did you see instead?
hystrix-go has no third-party dependencies except in test code. hystrix-go tests depend on goconvey, which in turn depend on gls, which depends on gopherjs in a file with a
js
build tag (as an aside: it seems many paths lead back to gopherjs when go modules are involved).I would expect go.mod to not contain indirect test dependencies (it's not the responsibility of this project to run its dependencies' tests). Further, I would like some level of control in the go.mod file over build tags that are included or excluded. For example, excluding (or not including) the js tag from being considered in module operations, such as via a go.mod "tags" directive, would avoid much of this issue.
The text was updated successfully, but these errors were encountered: