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:

  1. Download the required packages/software according to your platform
  2. Install and set system variables
  3. 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:

  1. 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
  2. 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 your $HOME/.profile or /etc/profile(for all user installation): export PATH=$PATH:/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 $HOME/.profile
For Mac

open the downloaded package file and follow the prompts with instructions to install Go.

The package will install the Go distribution to /usr/local/go directory. The /usr/local/go/bin directory should be put in thePATH environment variable by the package. You may need to restart any open Terminal sessions to reflect the changes.

3. Test whether the installation is working or not

To verify that you have installed the correct version of Go, open the command prompt or terminal and type $ go version . Then check whether it prints the installed version of Go or not.

Share on Social Media
Mukuldeep Maiti

Mukuldeep Maiti

An unrecognized crazy being with random thoughts lost in unknown

You may also like...

Leave a Reply