Install Go-Lang to your local system
Go Programming language, also known as go-lang, a popular programming language introduced by google, gained recognition among new generation programmers in a shorter span of time. Installing Go-lang is much easier than you think. You have to follow these three basic steps as described below:
- Download the required packages/software according to your platform
- Install and set system variables
- Test whether the installation is working or not
1. Download
Currently, Go-lang is officially available for Windows, Linux, and Mac Systems. you can download from https://golang.org/doc/install#download
Once the download is complete you can follow the next steps according to your platform.
2. Install (Windows/Linux/Mac)
For Windows
Open the downloaded MSI file and follow the prompts and instructions to install Go. You can change the default install location i.e. C:\Go as needed in installation prompts. Once successfully installed you have to reopen any opened command prompts so that changes in the environment made by the installer are reflected at the command prompt.
For Linux
Before installing Go, make sure you have uninstalled and removed all the files from any previous version of Go (iff installed earlier). Then follow these steps:
- create a ‘go’ tree or directory in ‘/usr/local’ and extract the downloaded archive in it.
- for example, run the following using sudo terminal
tar -C /usr/local -xzf go1.14.3.linux-amd64.tar.gz
- for example, run the following using sudo terminal
- set ‘/usr/local/go/bin’ as a
PATH
environment variable.- you can add ‘/usr/local/go/bin’ as a
PATH
environment variable by adding the following line to yourPATH:/usr/local/go/bin
- Changes made to the profile file may not reflect until the next time you log in to the profile. To apply the changes immediately, run the shell commands directly or execute them from the profile using command such as
source
. Then check whether it prints the installed version of Go or not.go version
- you can add ‘/usr/local/go/bin’ as a