How to get all dependency files for a program

Below command works for me it downloads all the dependencies.

go get -u -v -f all

You can use godep save in your local pc where you complete your program. godep save collect all the dependency files for you. When you move to other pc, just copy the Godep folder with your code and it will solve your problems.


You can run go get -d ./... from a directory of your project to download all go-gettable dependencies.
Or copy all src subdirectory from your GOPATH to the destination machine.
... is a special pattern, tells to go down recursively.


Try

go list -f '{{ join .Imports "\n" }}'

or

go list -f '{{ join .Deps "\n" }}'

The second will list all subdependencies, the first only the directly imported packages.

Tags:

Go