Today I decided to start using Godep (dependency tool) to manage the versions of the packages I need in my Go projects. The idea is basic the same as Composer for PHP or package.json for Npm.

To run any of the following commands you need to have your GOBIN path set correctly.
To verify this, please run go env. If there is a path on the GOBIN, check that is the correct one. If not, please add export GOBIN=correct_path to your .bashrc, .profile or .bash_profile

It seams really simple and ease to use.

You just need to install/update it:

go get -u

And then you just have to go into your existing project and run:

godep save

If you get an error similar to this:

godep: Package ( not found you need to install

go get -d

If all goes ok, the command will create a Godeps folder and a vendor folder. Inside of Godeps folder you will have a Godeps.json file that contains all packages with their current versions. Inside the vendor folder will be all the packages needed for your current app.

Just add the Godeps folder to your VCS, Git for example:

git add Godeps/ && git commit -m "Added Godeps vendor listing for better
dependency management"

Also don’t forget to add vendor folder to you .gitignore

When you need to get the packages (in case of deployment, or somebody else using ur app) you just need to use the command:

godep restore

For more information, visit the Godep github url at:

Also this url ( contains several other dependency management tools for Go.