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

Comments

1 participant
@kemitchell
Member

kemitchell commented Jul 1, 2018

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

This comment has been minimized.

Member

kemitchell commented Jul 3, 2018

@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

This comment has been minimized.

Member

kemitchell commented Jul 3, 2018

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

@kemitchell

This comment has been minimized.

Member

kemitchell commented Jul 3, 2018

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 from Help Wanted: Guidance of Go Package Metadata to Help Wanted: Guidance on Go Package Metadata Jul 3, 2018

@kemitchell kemitchell closed this Jul 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment