I have Go installed, setup, and running hello world; I followed these directions. My workspace is organized as follows:
gocode/
bin/
pkg/
src/
github.com/
my_username/
hello/
hello.go
anomalyzer/
algorithms.go
...
README.md
I would like to start using Go code from a forked GitHub repo, lytics/anomalyzer. How can I do this? I forked the repo and setup a local clone in github.com/anomalyzer/
as shown above. But from the github.com/anomalyzer/
dir I try go install
and get the error message algorithms.go:5:2: cannot find package "github.com/drewlanenga/govector" in any of: ...(lists my GOPATH)
. It looks like I need to also clone the github.com/drewlanenga/govector
, do I? Is there an automated way to get all the package dependencies?
To fetch remote packages, run the go get
command. Because the go get
command automatically fetches dependencies and does not fetch a package that already have have, you can run
go get github.com/lytics/anomalyzer
to get everything setup including the github.com/drewlanenga/govector
package.