Vendoring your dependencies

Up until now, we have simply installed Go libraries that we needed for the MyEvents application (such as the gopkg.in/mgo.v2 or the github.com/gorilla/mux packages) using the go get command. Although this works reasonably well for development, installing dependencies using go get has one significant disadvantage, that is, each time you run go get on a package that has not yet been downloaded, it will get the most recent version of that library (technically, the latest master branch of the respective source code repository). This can have nasty consequences; imagine that you have cloned your repository at one point in time and installed all dependencies using go get ./.... A week later, you repeat these steps, but ...

Get Cloud Native programming with Golang now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.