How to Install and Setup Environment for Go/Golang on Windows
In this tutorial, you will learn how to download, install and set environment for Go programming language on Windows.
- The first thing you'll need to do is go the the official website of Go programming language at https://go.dev/dl/ and download Go installer for Microsoft Windows.
- After downloading the Go installer, double click on it to start the installation process.
- Install it with the default installation settings and steps.
- Now, its time to set up an environment variable path for Go.
- Type env in the search and click on the Edit the system environment variables shortcut as shown in the image below:
- On the System Properties window, click Environment Variables button.
- Under System variables, click New.
- Enter GOPATH in the Variable name field. Browse and select the Go installation directory in the Variable value field as shown below:
- Choose OK button and restart your computer.
- Verify the installed version of Go by executing the following command on your terminal:
The above command should print something like below:go version go1.17.5 windows/amd64
- Next, download Visual Studio Code IDE at https://code.visualstudio.com/download and install it.
- After the installation of Visual Studio Code IDE, launch it and install extension for Go as shown in the image below:
Environment setup for the Go programming language is complete. Now, you can work on creating and running Go programs.