Installing Go

How to install golang and set up a golang development environment

1. Installing Go on MacOS and Windows

To install Go, visit https://go.dev/doc/install

Select what operating system you are using and download the golang binary file. Click on the downloaded file and follow the installation instructions.

To verify if go installed successfully, open a new terminal window and run the following command:

$ go version

This will output something similar to the following:

go version go1.19.1 darwin/amd64

The output above may be different for you depending on what version of go you install

2. Using Go in VSCode

The golang extension for VSCode provides various features including code completion, intellisense, syntax highlighting and debugger integration.

glang extension for VSCode

To install the golang extension for VSCode, open VSCode and under the extensions tab, search for "golang." Install the extension by clicking the "install" button next to the extension. For more information about the golang extension, vissit: https://code.visualstudio.com/docs/languages/go

The next section will cover how to write a simple go application and compile the application to a binary.

Last updated