Best way to install go in Mac is download official dmg file and install.
Check that Go is installed correctly by setting up a workspace and building a simple ‘hello world’ program.
Create a workspace directory for go project. set the GOPATH environment variable to point to that location.
mkdir go_work
and
export GOPATH=$HOME/go_work
Next, make the directories src/github.com/user/hello inside your workspace
Inside the hello directory create a file named hello.go with the following contents: