Skip to content

Latest commit

 

History

History

Go

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Installation

How to install Go Ubuntu

$ sudo apt-get update

$ wget -c https://dl.google.com/go/go1.17.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local

Adjusting the Path Variable :

$ sudo echo 'export GOPATH=$HOME/work' >> ~/.profile
$ sudo echo 'export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin' >> ~/.profile
$ source ~/.profile

OR

$ sudo nano ~/.profile

At the end of the file, add this line:

export GOPATH=$HOME/work
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin

(ctrl+s and ctrl+x to exit nano)

$ source ~/.profile

to know version :

$ go version 

How to run

$ go run HelloWorld.go 

how to uninstall Go

$ sudo apt-get remove --auto-remove golang-go.