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

Add support for golang 1.11+, go modules #113

Merged
merged 8 commits into from
Dec 27, 2018
Merged

Add support for golang 1.11+, go modules #113

merged 8 commits into from
Dec 27, 2018

Conversation

jonabc
Copy link
Contributor

@jonabc jonabc commented Dec 27, 2018

This PR updates the Go dependency source enumerator to better support newer versions of the Go language.

  1. Uses the go list -deps option to get all dependencies in a single call rather than needing to call go list for each dependency.
  2. If a go project is set up to use modules, uses the modules version number instead of a git SHA1 for version information

This ended up including a non-trivial refactor of the go dependency source to give an easy branching point for sourcing package information for older go versions vs go list -deps as described in (1) ☝️ .

push error catching logic inside of `packages`
- use `go list -json -deps` when available for better perf
- use go module version if available
test caching and listing w/, w/o go modules
@jonabc jonabc merged commit de1a148 into master Dec 27, 2018
@jonabc jonabc deleted the golang-mod-support branch December 27, 2018 19:54
@jonabc jonabc mentioned this pull request Dec 27, 2018
@jonabc
Copy link
Contributor Author

jonabc commented Dec 27, 2018

Uses the go list -deps option to get all dependencies in a single call rather than needing to call go list for each dependency.

In the CI environment, the go 1.11.x tests consistently run ~1minute, ~33% faster than for previous versions due to this speedup 🎉 ! And thats only for 2-3 dependencies in the test project. For go projects with a significant number of dependencies the change will be even more dramatic.

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

Successfully merging this pull request may close these issues.

1 participant