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.