Welcome To Golang By Example

GO Installation

This is the chapter 2 of the golang comprehensive tutorial series. Refer to this link for other chapters of the series – Golang Comprehensive Tutorial Series

Next TutorialSet up GO Workspace and Hello World Program
Previous TutorialAbout Golang

Now let’s check out the current tutorial. Below is the table of contents for current tutorial.

Overview

GO is available to be installed on Win, Mac, and Linux platforms. You can download the binary of the latest GO version from the GO’s official download page – https://golang.org/dl/

GO is available to be installed on Win, Mac, and Linux platforms.

Installation on MAC

GO can be installed on MAC in three ways

Let’s look at all the three ways

Using .pkg installer

Install

/usr/local/go

Test Installation:

Uninstall

To uninstall do below two steps:

rm -rf /usr/local/go      //Will require sudo permission
rm -rf /etc/paths.do/go   //Will require sudo permission. This action deletes will remove /usr/local/go/bin from PATH env

Using archive

Install

tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz
export PATH=$PATH:/usr/local/go/bin

Test Installation

Go is a tool for managing Go source code.

Usage:

go  [arguments]
.....

Uninstall

To uninstall perform below two steps

rm -rf /usr/local/go 
export PATH=$PATH:/usr/local/go/bin

Using brew

Install

Simplest way to install GO on MAC is using the brew.

brew install go

Test Installation

Uninstall

To uninstall simple run command

brew uninstall go

Installation on Linux and Free BSD

Downloading the archive

Install

Test Installation:

Uninstall

To uninstall do below two steps

export PATH=$PATH:/usr/local/go/bin

Installation on Windows

Using .msi installer

Install

c:\Go

Test Installation

Uninstall

To uninstall do below two steps

Conclusion

This is all about golang installation. Hope you have liked this article. Please share feedback or mistakes or improvements in comments

Next Tutorial – Set up Go Workspace and hello world program
Previous Tutorial – About Golang