Install Go toolchain
There are 2 production quality compilers:
- gc, the official compiler
- gccgo. Also created by the Go project, but not used as often as gc.
This article describes installing gc compiler.
Install on Windows
.msi installer downloaded from https://golang.org/dl/.
Install on Mac OS
Using official binaries
.pkg installer from https://golang.org/dl/ and run it.
- if you don’t have Homebrew installed, install it following the instructions
brew install go
Install on Ubuntu
Using Ubuntu provided package
$ sudo apt-get update $ sudo apt-get install go
Note that packages provided by Ubuntu are often outdated. A new version of Go is released every 6 months but Ubuntu distribution moves at a slower pace.
For that reason we recommend installing the binary packages.
Using binary packages
These instructions work on pretty much every Linux distribution:
$ sudo apt-get update $ sudo apt-get install -y build-essential git curl wget $ wget https://storage.googleapis.com/golang/go<versions>.gz
You can find the version list here.
# To install go1.9.3 use $ wget https://storage.googleapis.com/golang/go1.9.3.linux-amd64.tar.gz # Untar the file $ sudo tar -C /usr/local -xzf go1.9.3.linux-amd64.tar.gz $ sudo chown -R $USER:$USER /usr/local/go $ rm go1.9.3.linux-amd64.tar.gz
Install on other OSes
Follow official instructions.