Welcome To Golang By Example

Install GO (aka Golang) on MAC

Overview

GO is available to be installed on Win, Mac, and Linux platforms. 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 do 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