Trusted answers to developer questions

How to check the Golang version on Mac

Faraz Karim

Grokking the Behavioral Interview

Get Educative’s popular interview prep course for free.

To check if Go is installed on your system, you can run the following command:

$ go

If there is no error and the mouse pointer keeps blinking, then it means a version of Go is indeed installed on your system.


To find out what version of Go is installed, you need to run Go with the version flag version:

$ go version

This will tell you the version of Go installed on your system.


Firstly, you must download the latest official Golang release, which you can find right here. Or, you can run the following curl command to download the required package:

$ curl -o golang.pkg 

Now, to install the Go distribution, run the following command:

$ sudo open golang.pkg

This will open the Go installation wizard. Follow through with the wizard instructions to complete your installation.


Now that you have installed the Go release on your system, you need to set environment variables. Running the following three commands will set the required environment variable paths:

$ export GOROOT=/usr/local/go 
$ export GOPATH=$HOME/Projects/Proj1  
$ export PATH=$GOPATH/bin:$GOROOT/bin:$PATH 

With this, you have successfully installed and set up your Go workplace. Check if everything is working properly by checking the version, using the following command:

$ go version




Faraz Karim
Copyright ©2023 Educative, Inc. All rights reserved
Trusted Answers to Developer Questions

Related Tags

Keep Exploring
Related Courses