2 Oct 2012
Here’s the setup I use for compiling Go binaries, as well as for writing .deb’s to package them and markdown for README’s - notes for me.
Install build pre-requisites:
sudo aptitude install gcc libc6-dev libc6-dev-i386 make \
markdown build-essential debhelper dh-make fakeroot devscripts
Install Go from source (so can cross-compile). Download from Go Downloads eg go1.0.2.src.tar.gz
sudo tar -C /usr/local -xzf go1.0.2.src.tar.gz ; cd /usr/local/go/src
sudo GOARCH=amd64 ./all.bash ; sudo GOARCH=386 ./all.bash
Add to /etc/profile, source or re-login:
export GOROOT="/usr/local/go"
export PATH="$GOROOT/bin:$PATH"