Disable/enable a Go vendor folder, with this shell script.
_Initialise your .gitignore file, by ignoring novendor.
vendoff.sh init
_Move vendor to novendor. Temporarily ignore changes (removal of 'vendor') in your repo, using 'skip-worktree'.
vendoff.sh off
_Move novendor back to vendor. Remove the 'skip-worktree' options from the vendor folder
vendoff.sh on
- Easily experiment with different versions of dependencies.
- You may want to try out a new/experimental version of a dependency - check that everything works, and then back out.
- For me this is part of my workflow. I commonly use a shared repo alongside a range of dependent projects. It is important to test changes locally.
- GO15VENDOREXPERIMENT will be removed in Go1.7.
- I used to use this environment variable to acheive a similar thing - it's not available any longer!
- See golang/go#16562 for the issue I reported about this.
- This works with git only.
- This is intended to be used with tools like
godep
,glide
,govendor
, etc. Obviously don't try running these tools while you have your dependencies in the _novendor folder. - I don't think it works with git submodules, but it might. YMMV.
- Experimental, yada yada.