Vendoring and project layout
Vendoring Go applications is still a largely unresolved issue. There are discussions and plans to produce an official vendoring solution (https://github.com/golang/dep), but it's very early days and things are far from complete. For now, there are a number of alternative solutions. By default, you can place packages into a local vendor directory to use them instead of those in your GOPATH
environment variable. This allows packages to pin on the version in their vendor directory and allows for reproducible builds without having to commit your entire GOPATH
into version control. Most package managers take advantage of this. For this recipe, we'll explore the layout for a web application and how to manage its vendor dependencies with godep
github.com/tools/godep, a popular tool for managing dependencies.
Getting ready
Configure your environment by performing these steps:
- Refer to the Getting ready section of the Speeding up compilation and testing cycles recipe in this...