Go Get: Install All Packages

· 140 words · 1 minute read

Go has a simple built in way to download packages. If you’ve programmed in Go, you’ve likely used the go get command before (view docs). It often works something like this:

go get -u github.com/gorilla/mux

Which is great - but! What if you want to download all the packages linked to your project? This commonly happens if you pull a new project down using version control and don’t want to go get each package individually.

The answer is to use go get within the current project and tell it to find all required packages recursively by using this command:

go get -u ./...

(We’re including the -u parameter to also update any existing packages.)

If you’re want to see what’s happening with this command, as it’s a quiet command, the add the -v parameter to add a layer of verbosity.

Image of Author Edd Turtle

Author:  Edd Turtle

Edd is the Lead Developer at Hoowla, a prop-tech startup, where he spends much of his time working on production-ready Go and PHP code. He loves coding, but also enjoys cycling and camping in his spare time.

See something which isn't right? You can contribute to this page on GitHub or just let us know in the comments below - Thanks for reading!