Setting up Go on OS X
Setting up Go on OS X involves several steps.
Install Go using Homebrew
~# brew update ~# brew install go
Install Eclipse. I prefer Eclipse for Java Developers.
Install GoClipse from the update site:
- Install gdb:
- Download gdb source file: http://www.gnu.org/software/gdb/download/
In Terminal; ~# cd ~/Downloads/gdb-x.x ~# ./configure ~# make ~# sudo make install ~# gdb --version (check version) ~# which gdb (check where it is installed)
Create a go directory to house your personal go binary installs and sources for bash support. In a Terminal: ~# mkdir go ~# cd go
export GOPATH=/Users/rmunn/go export GOBIN=$GOPATH/bin export PATH=/usr/local/bin:$PATH:/usr/local/Cellar/go/1.2.1/libexec/bin
~# go get github.com/nsf/gocode
- Install Mercurial if you don't have it:
~# brew install hg
- Install godoc and govet:
~# go get code.google.com/p/go.tools/cmd/godoc
~# go get code.google.com/p/go.tools/cmd/vet
- Configure the Go Preferences in Eclipse
If you run into problems along the way, most likely $GOPATH or $GOBIN are not set correctly, or the proper tools are not installed (e.g. Mercurial). Check the Web for solutions to particular errors.