Skip to content

Latest commit

 

History

History
39 lines (25 loc) · 1018 Bytes

Installation.md

File metadata and controls

39 lines (25 loc) · 1018 Bytes

OS: Debian/Ubuntu

Download page: https://golang.org/dl/

Install go at etc directory

wget https://dl.google.com/go/go1.11.4.linux-amd64.tar.gz
tar zxvf go1.11.4.linux-amd64.tar.gz -C /etc

Set GOROOT, PATH and GOPATH Environment_Variables

  • GOROOT: Location of go tools binary distributions. In the previous step, we have installed go at /etc/go directory.

  • PATH: $GOROOT/bin

  • GOPATH: Location of workspace. For this tutorial, we will create a workspace at $HOME/go_workspace/go directory.

For active session

export GOROOT=/etc/go
export PATH=$PATH:$GOROOT/bin
export GOPATH=$HOME/go_workspace/go

Automatically set Environment_Variables every time physical machine is powered on

echo 'export GOROOT=/etc/go' >> $HOME/.profile
echo 'export PATH=$PATH:$GOROOT/bin' >> $HOME/.profile
echo 'export GOPATH=$HOME/go_workspace/go' >> $HOME/.profile

Verify: go version