Install Go

In this post we look at installing the Go programming language and setting up Visual Studio Code as your code editor.

Install Go

Visit https://go.dev/dl and download the binary package for your operating system.

Note, there are two different version for macOS, one for Intel-based Macs (x86-64) and another for Apple processors (ARM64). If you have an Apple computer, you will need to check what hardware you have. To do this, click the Apple logo () in the Menu Bar and select About This Mac.

About This Mac

You will see a list of items as shown in the image above. If the Chip says ‘Apple M1’ or higher, you have an Apple processor.

After you download the installer suitable for you system, run it. The installer will check if any previous version of Go exists and if it does, it will be removed during the installation process.

Golang installer

Proceed with the installation, select all the default options, and enter your password when prompted.

Check that Go was installed correctly by opening Terminal and typing the following:

go version

You should see the following returned. Though, your version number may be different.

go version go1.19.2 darwin/arm64

Install VS Code

Visual Studio Code, commonly known as VS Code, is a free code editor that lets you write programs in Go and many other languages. Download the app from https://code.visualstudio.com and install it on your computer.

VS Code comes with optional extensions that can improve your productivity and help make the programming experience more enjoyable.

With VS Code open, click the Extensions icon on the left menu or select the Code menu > Preferences > Extensions to open the Extensions tab.

Enter ‘go’ in the search box and install the Go extension from Google. The Go extension adds rich language support to VS Code such as IntelliSense, code formatting, coding linting, and more.

Go VS Code extension

Different color themes are available to install in VS Code and stylize your code with different font and background colors. Choosing a theme is entirely optional and a personal preference. There are probably hundreds of themes to choose from.

Visit the VS Code documentation to learn more about this feature. You can preview and compare most of the high-quality themes on the website: https://vscodethemes.com/.

Summary

In this short post we looked at how to install Go and VS Code on your computer. In future lessons, we cover the basics of Go programming and its standard library. Check out our Go reading list for more information.