Step-by-Step installation of Golang on Mac OS

Step by Step installation of Golang on Mac OS.

There are various ways to download and install Golang on the Mac OS but I am going to explain the easiest one.

Saving some time to learn Golang. 😉

Step 1. Download Golang from Official website

Navigate to and download Golang(.pkg) package.


Step 2. Open the package and follow installation steps

/step-by-step-installation-of-golang-on-mac/golang_installation_on_mac_4.jpg /step-by-step-installation-of-golang-on-mac/golang_installation_on_mac_6.jpg

Step 3. Verify Installation

Once the installation is completed. Open terminal and type > go version ↵ and you should be able to see some information like > go version go1.14.6 darwin/amd64


Step 4: Verify Environment Variables

Use the command > go env ↵ to check Golang env variables.


Step 5: Download and Install VS Code

Following IDE supports Golang but for this tutorial, I am going to use VS Code.

  1. Visual Studio Code (VS Code is free and built on open source)
  2. IntelliJ IDEA
  3. Vim
  4. Sublime Text
  5. Eclipse
  6. Atom
  7. GoLand
  8. LiteIDE

Download VS Code from and follow the procedure to install.

Step 6. Configure VS Code for Go

Once VS Code is installed, Go to Code > Preference > Extension or press ⌘⇧X Search Go extension in marketplace and install.


Step 7. Project folder setup

There is a basic layout available for Golang application projects. It’s not an official standard defined by the core Go, dev team; however, it is a set of common historical and emerging project layout patterns in the Go ecosystem. Some of these patterns are more popular than others.

Refer for more information on the Go Project Layout.

You can create a folder structure manually or you can just download any template of go project from the GitHub.

In this tutorial, we will use

Use command > go get ↵ to download helloworld template.


A project workspace would be created once the template is downloaded. You can see the PATH of workspace in > go env or you can navigate to /Users/<<user_name>>/go folder.


Step 8. Install support Go packages

The quick and easiest way to install Golang packages is from VS Code. To install, Open helloworld template in VS Code.

Navigate to main.go and start typing something. As soon as you type, a popup will be displayed as shown below,


Few additional packages are required for Goland while using VS Code so click on “Install All” and install all packages.

The below message will be displayed in the terminal once the installation is completed.


Step 9. Finally, Run and Test Go Program

  • To run go code, use > go run <<file_name.go>> ↵
  • To test go code, use > go test ↵


Hope you liked this quick tutorial to install Golang with VS Code on Mac. Happy Go ❤️ Programming!