- Update and upgrade apt
sudo apt-get update
sudo apt-get -y upgrade
- Install git
- Fetch, unzip and move go sources (please check the latest version)
wget https://dl.google.com/go/go1.16.4.linux-amd64.tar.gz
sudo tar -xvf go1.16.4.linux-amd64.tar.gz
sudo mv go /usr/local
- Set the environment variables
vi ~/.bashrc
export GOROOT=/usr/local/go
export GOPATH=$HOME/work
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
- Check the installation
- Install git from this address
https://git-scm.com/download/win
- Install golang from this address
- Set the environment variables
setx GOROOT=C:\Go
setx GOPATH=%USERPROFILE%\go
setx PATH=%PATH%;%GOROOT%\bin;%GOPATH%\bin
- Check the installation
- Update brew
- Install git
- Install golang
- Set the environment variables
vi ~/.bashrc
export GOROOT=/usr/local/go
export GOPATH=$HOME/work
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
- Check the installation