This is a created article in which the information may have evolved or changed.
I will install the Go Language development environment on Mac OS X's development machine.
Go language Runtime package download address: http://code.google.com/p/go/downloads/list
Here I choose to install go1.0.3.darwin-amd64.pkg
Click Install on Mac, run package automatically install to/usr/local/go, so you can run go command at command Terminal.
Here, I install the Go editor into my Xcode application, because my Xcode is more than 4.x
In/usr/local/go/misc, you can see there are a lot of editor versions, here to find the Xcode directory, inside into 4, there is a go4xcode.sh
In the terminal, enter:
sudo sh
./go4xcode.sh
There may be, you will report the following error:
Xcrun:Error:could not stat active Xcode path '/volumes/xcode/xcode44-dp7.app/contents/developer '. (No such file or directory)
Can view this workaround: Http://stackoverflow.com/questions/11456918/change-xcrun-developer-path
Solved by Xcode-select command.
The default Mac installs the Go run package, does not add the GOROOT environment variable, you must be added a goroot to/usr/local/go the directory, so that when the go4xcode.sh is executed, there will be no error.