Skip to content
This repository has been archived by the owner on Feb 26, 2019. It is now read-only.

Remove no longer needed dependencies #478

Open
tobstarr opened this issue May 25, 2016 · 3 comments
Open

Remove no longer needed dependencies #478

tobstarr opened this issue May 25, 2016 · 3 comments

Comments

@tobstarr
Copy link

I used to work with import path rewriting with godep and I recenlty switched to storing my dependencies in vendor.

I guess (not 100% sure) godep also took care of removing dependencies which I no longer used in my code from the workspace but it seems this is no longer the case? I could not find anything in the README regarding this functionality. How can I do that cleanup (besides deleting Godep/Godeps.json and vendor and and running godep save again)?

@freeformz
Copy link

Thanks for the report!

I don't think there is a test for that. I'll check and add one if there isn't and see if I can get it passing.

The easiest way to do this atm is:

$ godep restore -v
$ rm -rf Godeps vendor
$ godep save <pkg spec>
$ git commit -av

The restore downloads and checks out your project's deps into $GOPATH. This makes it so that when you save again you get the same version of the deps re-saved. Anything that is no longer necessary won't be saved. Also any new tweaks to the save process are applied if you are using the latest godep (perms, stricter package matching, etc). I suggest upgrading to the latest version of godep before doing any of this.

@kevinburke
Copy link

It would also be nice to have this info in the README next to "[Add/Update] a Dependency"

@HuKeping
Copy link

How's this going?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants