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
proposal: cmd/go: add transitive Deps for TestImports and XTestImports #23806
Comments
How about one single That would mirror what the |
@mvdan that seems reasonable and targets my use case equally well. |
Happy to give it a go if others agree on the design. |
Also, I'm thinking now that it probably requires a better name, if we are to mirror Perhaps |
The discussed change would be valuable for Debian as well, where we currently query Edit: it was pointed out to me that in the particular use-case (generating the Built-Using field), excluding testing deps is actually correct, so nevermind :). |
I'm repurposing this as a proposal, in the hopes that a decision will be made on it while the Go 1.11 tree is open. The proposed change isn't trivial either, so it makes sense to have a proposal. |
Thanks @mvdan. Let me know if i can be of any assistance with context related to my use. |
We will need to address this more generally for the new go/loader package. I think this can wait until after that's done - it will probably just fall out naturally. |
go list
provides a.Deps
which has the recursive list of dependencies for.Imports
. This is important because it provides the complete list of dependencies that must be fulfilled to rungo build
Unfortunately there is no recursive dependency provided for
TestImports
orXTestImports
. Those have a dependency tree that needs to be fulfilled in order togo test
but it's non-trivial to retrieve that dependency list. (especially when trying to filter out stdlib entries)Currently
What's expected?
This would allow a command like the following to output the complete set of dependencies needed to run
go build
orgo test
.Currently you have to run
go list '{{join .Deps "\n"}}' $import_path
on each import path from.TestImports
and.XTestImports
.The text was updated successfully, but these errors were encountered: