Go Dep Example
Lets install dep. On mac, you can do the following:
brew install dep
dep initThis will generate following tree
├── Gopkg.lock ├── Gopkg.toml ├── README.md └── vendor
Now import the new package in the code. We will import github.com/franela/goreq. You will see your IDE complaining about not being able to find the package, since its not yet installed. We will do that next. You can confirm this by running
Run dep ensure If you run
dep statusnow it will confirm the package is installed. Also, the vendor directory now will have the following files from the package:
vendor └── github.com └── franela └── goreq ├── LICENSE ├── Makefile ├── README.md ├── goreq.go ├── goreq_test.go └── tags.govendor
You are ready, go change the world !
P.S. This post is also published on medium.