This is a companion to https://go.dev/doc/install/source providing additional instructions for various operating systems.
On OS X, a C compiler is bundled in the command line tools for Xcode, and you don't need to install the whole Xcode to compile Go. If you have already installed Xcode 4.3+, you can install command line tools from the Components tab of the Downloads preferences panel. In more recent versions of Xcode, you can use
xcode-select --install command to install the command line tools without opening Xcode. To verify you have a working compiler, just invoke
gcc in a freshly created Terminal window, unless you see the
"gcc: command not found" error, you are ready to go.
On Ubuntu/Debian, use
sudo apt-get install gcc libc6-dev. If you want to build 32-bit binaries on a 64-bit system you'll also need the
On RedHat/Centos 6, use
sudo yum install gcc glibc-devel. If you want to build 32-bit binaries on a 64-bit system you'll need both