Following the steps. If you are checking issues regards some error with your GOROOT may it will solve your problem.
- Add the ENV VAR’s in your bash_profile as follows. (vim ~/.bash_profile)
export GOPATH="${HOME}/.go" export GOROOT="$(brew --prefix golang)/libexec" export PATH="$PATH:${GOPATH}/bin:${GOROOT}/bin"
- Run the following command to create the $
GOPATH
$ mkdir "${GOPATH}"
- Run the following command to create the GitHub dir on it. If all is ok, then this dir should be found in the $GOPATH.
$mkdir -p "${GOPATH}/src/github.com"
- Now, install the GO
$ brew install go
- Also, get some GO utilities.
$ go get golang.org/x/tools/cmd/godoc
$ go getgolang.org/x/lint