The Go get tool
Go get is a tool to get third party projects from CVS repositories. Instead of using the git clone
command, you can use Go get to receive a series of added benefits. Let's write an example using CoreOS's ETCD project which is a famous distributed key-value store.
CoreOS's ETCD is hosted on GitHub at https://github.com/coreos/etcd.git. To download this project source code using the Go get tool, we must type in the Terminal it's resulting import path that it will have in our GOPATH:
$ go get github.com/coreos/etcd
Note that we have just typed the most relevant information so that Go get figures out the rest. You'll get some output, depending on the state of the project, but after, while, it will disappear. But what did happen?
Go get has created a folder in
$GOPATH/src/github.com/coreos
.It has cloned the project in that location, so now the source code of ETCD is available at
$GOPATH/src/github.com/coreos/etcd
.Go get has cloned any repository that ETCD could need.
It has tried...