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:
- Look for existing dependency management files to convert
- Check if your dependencies use dep
- Identify your dependencies
- Back up your existing
vendor/directory (if you have one) to_vendor-TIMESTAMP/ - Pick the highest compatible version for each dependency
- Generate
Gopkg.toml(“manifest”) andGopkg.lockfiles - Install the dependencies in
vendor/