The following steps are for Linux.
Step 1: remove current version
first, need to uninstall the installed version:
Delete the /usr/local/go
directory by:
sudo rm -rf /usr/local/go
Step 2: Install the new version
Go to the downloads page and download the binary release suitable for your system.
Step 3: Install latest version
To extract the archive file:
$ sudo tar -C /usr/local -xzf /home/nikhita/Downloads/go1.8.1.linux-amd64.tar.gz
Step 4: Verify your PATH env variable
$ echo $PATH | grep "/usr/local/go/bin"
Make sure you are using the latest version with
go version