Environment configuration:
RyanMacbookPro:work$ env | grep GO
GOBIN=/usr/local/go/bin
GOARCH=amd64
GOROOT=/usr/local/go
GOOS=darwin
GOPATH=/Users/ryan/go
Perform installation
sudo go get github.com/nsf/gocode
prompt:
cannot download, $GOPATH not set. For more details see: go help gopath
solution:
sudo env GOPATH=/Users/ryan/go go get github.com/nsf/gocode