Installing Go on your computer
The Go download and install instructions (https://golang.org/doc/install#install) require you to download a file from https://go.dev/ and follow a couple of instructions. We include here the steps for Go version 17.7, which is the latest version available at the time of writing. Newer versions of Go 1 should continue to work.
Windows
To install Go on Windows, follow these steps:
- Download https://golang.org/dl/go1.17.7.windows-amd64.msi.
- Execute the
go1.17.7.windows-amd64.msi
file and follow the instructions. - Open the Command Prompt window (
cmd
) and rungo version
to verify the installation.
Mac
If you have Homebrew installed, you can run brew install go
. Otherwise, you can follow these steps:
- Download https://golang.org/dl/go1.17.7.darwin-amd64.pkg.
- Execute the
go1.17.7.darwin-amd64.pkg
file and follow the instructions. - Open a Terminal and run
go version
to verify the installation.
Linux
Go is typically available as a system package in a Linux distribution, but is often an older version. Follow these steps to install a more recent release:
- Download https://golang.org/dl/go1.17.7.linux-amd64.tar.gz.
- Remove any existing Go installation with
rm -
rf /usr/local/go
. - Extract the archive you downloaded into
/usr/local with tar -C /usr/local -
xzf go1.17.7.linux-amd64.tar.gz
. - Add
/usr/local/go/bin
to thePATH
environment variable withexport PATH=$PATH:/usr/local/go/bin
. To make this persistent, add this line as well in$HOME/.bash_profile
. This last part is valid forbash
, but you might want to do something similar if you use a different shell. - Run
go version
to verify the installation
There you go! You can now download and install Go in your system without any hassle. To install a different version, just replace 17.7
in the instructions with a target version of your choice.