$ go get -u github.com/golang/dep/cmd/dep
dep will analyize your project, identify your dependencies, pick the highest compatible version for each dependency,
generate a Gopkg.toml manifest and Gopkg.lock files
(see here for background on the two file format),
and install dependencies in vendor/.
$ dep init
Notes:
- If you are already using glide, godep, vndr, or govend, dep will convert the existing dependency management file. See this issue and this interface for implementing configuration importers.
- If you have an existing
vendor/directory, it will be backed up to_vendor-TIMESTAMP/.
$ dep ensure
dep's solver regenerates Gopkg.lock if it detects any change in your code imports and/or Gopkg.toml. If this is
the case, then the new Gopkg.lock file is used to completely rewrite vendor/ (at some point
vednor verification will allow the contents of vendor/ to also be
checked for consistency with Gopkg.lock, updating only what is necessary to make the contents current.
Note:
This process may be slow for large projects, especially the first time as dependencies are cloned or when it hasn't been run in a while and there are many changesets to fetch. dep manages a cache at $GOPATH/pkg/dep to mitigate fetch overhead. See
here for further details.
$ dep ensure -add github.com/foo/bar
dep will update your Gopkg.toml, Gopkg.lock, and vendor/.
As a user of python virtualenvwrapper I would recommend being able to create a virtual dependancy tree anywhere and make the project dependant on it