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

Help Wanted: Guidance on Go Package Metadata #10

Closed
kemitchell opened this issue Jul 1, 2018 · 3 comments
Closed

Help Wanted: Guidance on Go Package Metadata #10

kemitchell opened this issue Jul 1, 2018 · 3 comments
Assignees

Comments

@kemitchell
Copy link
Member

go list -f '{{ join .Deps "\n" }}' lists dependencies of the package in the current working directory. Is that the best way to inventory dependencies?

@kemitchell kemitchell added enhancement New feature or request help wanted Extra attention is needed question Further information is requested labels Jul 1, 2018
@kemitchell kemitchell self-assigned this Jul 1, 2018
@kemitchell
Copy link
Member Author

@coffeeboo, you inspired me to go ahead and take a crack at improving Go support. The master branch now recurses Go dependencies, even if they don't appear in the current working directory.

It can be a little slow, since I'm calling go list -f "..." $import for each dependency. I've done a bit of work to speed things up by skipping standard-library packages, but I'm sure there's more I could do.

@kemitchell
Copy link
Member Author

I've just tagged this work as v4.3.0. Travis CI should have binaries ready for us in a few minutes.

@kemitchell
Copy link
Member Author

To summary the approach as of 05d2cb1:

  1. Run `go list -f '{{ join .Deps "\n" }}' and split its output for a list of all dependencies.
  2. Iterate the list of dependencies:
    1. Skip those with known standard-library import names.
    2. Run go list -f $template $importfor the rest, parsing out name, path, import path, and whether it's a standard-library package.
    3. Try to read licensezero.json in the path for all non-standard-library packages.

@kemitchell kemitchell changed the title Help Wanted: Guidance of Go Package Metadata Help Wanted: Guidance on Go Package Metadata Jul 3, 2018
@kemitchell kemitchell removed enhancement New feature or request help wanted Extra attention is needed question Further information is requested labels Jul 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant