Saturday, December 30, 2017

package github.com/gorilla/mux: cannot download, $GOPATH not set

While installing a GO package, I am getting the following error.

# go get github.com/gorilla/mux
package github.com/gorilla/mux: cannot download, $GOPATH not set. For more details see: go help gopath


How to solve this error:

Login to the server.
# mkdir /path/to/a/folder
# vi ~/.bashrc
# export GOPATH=/path/to/a/folder
# source ~/.bashrc


Now try the command go get github.com/gorilla/mux, It works.



No comments:

Post a Comment