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

Enhancement: purge unused dependencies #6

Open
mmindenhall opened this issue Jul 14, 2015 · 6 comments
Open

Enhancement: purge unused dependencies #6

mmindenhall opened this issue Jul 14, 2015 · 6 comments

Comments

@mmindenhall
Copy link

I recently evaluated gb and wgo for a new Go project at my company (our first). We chose wgo due to the wgo restore command (we wanted to .gitignore the vendor/src folder).

One thing I really liked about gb was the gb vendor purge command, which "purges all unreferenced dependencies". As we're feeling our way through learning the ecosystem and evaluating competing libraries, I've already had to manually purge a couple of dependencies from vendor.json. It's easy enough to do manually, but it would be a nice addition to wgo.

Thanks!

@skelterjohn
Copy link
Owner

Thanks for the suggestion, seems like a good feature to have. I'll see if I can get something going soon.

@skelterjohn
Copy link
Owner

This turned out to be a bit tricky, since currently wgo doesn't really differentiate between code in W/vendor/src/ and W/src/, it just happens that one of those is listed first, and therefore gets things that are fetched with 'wgo get' or 'wgo save/restore'.

I'm planning on making the roles of vendor/src and src more explicit. To do so, I'm in the process of hashing out a standalone "workspace spec" with dave cheney. Once that's set, I'll move it into wgo and address this issue.

@andradei
Copy link

andradei commented Jul 9, 2016

Any updates on that feature?

@skelterjohn
Copy link
Owner

Thanks for the ping. I took another look today. The issue remaining for me is how to handle internal vendor dirs... Now that the location of the source you import depends on the location of the source importing it, things become a lot harder to deal with :( It looks like I need to recursively trace through all the imports myself (or wgo's self) instead of the simple "go list -f '{{.Deps}}' ./...". Blargh.

@skelterjohn
Copy link
Owner

Ok, added the feature. Let me know what you think, and if everything looks good I'll close this issue.

@andradei
Copy link

andradei commented Jul 11, 2016

That was quick! Seems to work.

I vendored a package that itself has subpackages. Added a couple more that I don't use. wgo purge --confirm gets rid of them.

That's a productivity boost. Thanks!

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

3 participants