How to download and install Go language on Ubuntu

How to download and install Go language on Ubuntu

In this article, we will see how to download and install Go language on Ubuntu Linux.

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

1. Download Go(golang) language for Linux using below command.

wget https://golang.org/dl/go1.15.5.linux-amd64.tar.gz

We can get the lastest go language download from Download link

How to download and install Go language on Ubuntu

2. Now, run the following as root or through sudo:

sudo tar -C /usr/local/ -xzf go1.15.5.linux-amd64.tar.gz

3. Set the Path environment variable.

export PATH=$PATH:/usr/local/go/bin

4. Lets verify go language installed version using below command:

go version

5. Create and execute first go program.

Create a go file

touch test.go

vi test.go

Press i to enter into insert mode and copy below lines of code and save file.

package main import "fmt" func main() { fmt.Printf("Please subscribe my channel\n") }

Now build go file.

go build test.go

Execute go program.

./test

Leave a Reply

Your email address will not be published. Required fields are marked *