Skip to content

Latest commit

 

History

History

02-installation

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

Installation

Ubuntu

  1. Update and upgrade apt
sudo apt-get update
sudo apt-get -y upgrade
  1. Install git
sudo apt-get install git
  1. 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
  1. Set the environment variables
vi ~/.bashrc
export GOROOT=/usr/local/go
export GOPATH=$HOME/work
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
  1. Check the installation
go version

Windows

  1. Install git from this address
https://git-scm.com/download/win
  1. Install golang from this address
https://go.dev/dl
  1. Set the environment variables
setx GOROOT=C:\Go
setx GOPATH=%USERPROFILE%\go
setx PATH=%PATH%;%GOROOT%\bin;%GOPATH%\bin
  1. Check the installation
go version

MacOS

  1. Update brew
brew update
  1. Install git
brew install git
  1. Install golang
brew install golang
  1. Set the environment variables
vi ~/.bashrc
export GOROOT=/usr/local/go
export GOPATH=$HOME/work
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
  1. Check the installation
go version