Golang,GOPATH未设置错误

I am getting the following error when I am trying to run the go code:

cannot find package "github.com/drone/routes" in any of:
    /usr/local/Cellar/go/1.5.1/libexec/src/github.com/drone/routes (from $GOROOT)
    ($GOPATH not set)

Any help would be highly appreciated.

Well it is saying that your GOPATH is not set. I would suggest taking a look at the Go docs to get that configured.

Set under the Windows: open cmd

C:\Users\zhg>set GOPATH=C:\PATH

C:\Users\zhg>echo %GOPATH%
>>> C:\PATH

Set under the Linux: open bash

zhg@ubuntu:~$ export GOPATH=$HOME/path
zhg@ubuntu:~$ echo $GOPATH 
>>> /home/zhg/path

Looking all go environment: $ go env

Set forever, you need to edit the environment files.