How to setup Go in Mac, Windows and linux

How to setup Go in Mac, Windows and linux:

Go installation and setup is easy. We can download the setup file and do the setup in a couple of minutes. Let me show you how.

Dowload the setup package:

Download the setup file from here. It will be different for mac, linux and windows.

Click on the installer file and complete the setup.

For example, it looks as like below in mac:

go install mac

Linux:

  • In linux, you need to extract it to /usr/local.
tar -C /usr/local -xzf downloaded-file.tar.gz
  • Add the below line to $HOME/.profile or /etc/profile:
export PATH=$PATH:/usr/local/go/bin
  • Reload the profile file:
source $HOME/.profile

That’s it. Now, check the version of go using the below command:

go version

Windows and Mac:

In windows and mac, the installer file does everything including the PATH update. You can use go version in a terminal to test the version installed.

go check version