gogodeps

Advice on vendoring dependencies in Go


I am working on a project that requires some dependencies. I am a little confused by the best practices regarding vendoring. Currently I am using GO15VENDOREXPERIMENT and have copied the dependencies into the vendor directory.

https://github.com/jeffellin/machine-cloudformation/tree/master/vendor/github.com

When I need to update the dependencies I checkout the source code manually from docker-machine and copy it into my vendor directory. This brings in a lot of unnecessary code, tests, etc. Is there any recommendations on automating this? I am used to maven where I can just specify version info in a configuration file.

What about GODEPS? How does that play into the GO15VENDOREXPERIMENT. I would prefer a solution where I don't have to checkin dependencies into my source tree.


Solution

  • There are a few tools that help with vendoring your dependencies. Most of them are able to handle GO15VENDOREXPERIMENT.

    For example: