How do I get all the dependencies to install at once?
That's what go get
does... it looks like something might be misconfigured or corrupted in your case. You could start by trying some things.
go get
installs into the first path in the $GOPATH environment variable. Confirm that it is set to what you want (usually a path ending in a directory named go
; subdirs src
, pkg
, etc. will be created).
If you're going to use ./...
, make sure you're calling go get
from the right directory.
Check to make sure the git root is in the right place
try using a non-wildcard name/path/address for the package you want to get, instead of ./...
try calling go get
without the -t
flag
If none of that works, you may be able to solve the problem by deleting the directory (home/travis/build/path/to/package) and trying again -- make sure you aren't deleting any code you worked on, or the git repository/files, unless it's backed up somewhere.
According to Go tools documentation, you should only need to call
go get [packages]
to install the named packages along with their dependencies:
Get downloads the packages named by the import paths, along with their dependencies. It then installs the named packages, like 'go install'.
The ...
ellipsis is a wildcard that can expand to match any string. See section on Description of Package Lists:
An import path is a pattern if it includes one or more "..." wildcards, each of which can match any string, including the empty string and strings containing slashes. Such a pattern expands to all package directories found in the GOPATH trees with names matching the patterns.
The ./
means "here": so make sure you're running from the right directory if you're going to use ./...
The -t
flag is for downloading the packages required to build the tests:
The -t flag instructs get to also download the packages required to build the tests for the specified packages.
The error you're seeing is related to git. Sometimes the cause is unknown, but it can often be fixed by deleting the directory and starting again (see, e.g., "Error to install golint" or "Correct way to get package")
(You might also find this blog post on configuring travis-ci for Go helpful.)