Setup

Grab the latest binary from the releases page.

On macOS you can install or upgrade to the latest released version with Homebrew:

$ brew install dep
$ brew upgrade dep

If you’re interested in hacking on dep, you can install via go get:

go get -u github.com/golang/dep/cmd/dep

To start managing dependencies using dep, run the following from your project’s root directory:

$ dep init

This does the following:

  1. Look for existing dependency management files to convert
  2. Check if your dependencies use dep
  3. Identify your dependencies
  4. Back up your existing vendor/ directory (if you have one) to _vendor-TIMESTAMP/
  5. Pick the highest compatible version for each dependency
  6. Generate Gopkg.toml (“manifest”) and Gopkg.lock files
  7. Install the dependencies in vendor/