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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access