Ubuntu

How to Install Go on Ubuntu 20.04

How to Install Go on Ubuntu 20.04

Go, or we can call it Golang, an open-source programming language created by Google in 2007 and publicly announced in November 2009. This procedural language allows users to build dependable, reliable, and efficient applications. Many well-known organizations prefer to Go programming languages such as Mangodb, Soundcloud, Netflix, Uber, etc.

Multiple advantages can be listed to show why Go should be preferred to be used. For instance, it is used for advanced performance in Networking, standard library, testing, static typing with level efficiency. More importantly, it supports lightweight processes that behave like threads and enable concurrent processing.

Install Go on Ubuntu 20.04 (LTS) and 20.10:

To get “Go”, use the command given below in the terminal:

$ sudo apt install golang

Downloading and installation will be completed within few seconds.

To verify, use the following command:

$ go version

As it can be seen that it is installed, and output is showing a version of Go. Let's get started with Go language to test its working:

Getting started with Go:

Firstly, create a workspace directory named “go”:

$ mkdir ~/go

Then, inside the workspace, create a subdirectory “src” :

$ mkdir -p ~/go/src/

Once your directory is created, make a new file named “hello.go” and write a program to print “Hello World” in the terminal:

To get the output of this program, type:

$ go run hello.go

Another aspect of Golang is that you can also build executable files from source code.

To run the hello.go file, use:

$ go build hello.go

Now, run that executable file:

$ ./hello

Conclusion:

In this guide, we have installed Go on Ubuntu and also checked its example as well. Go is a procedural language developed by Google, and many applications like Terraform, Docker, are using this language.

Linux'ta GameConqueror Cheat Engine Nasıl Kullanılır
Makale, Linux'ta GameConqueror hile motorunu kullanma hakkında bir kılavuzu kapsar. Windows'ta oyun oynayan birçok kullanıcı, oyun deneyimini geliştir...
Linux için En İyi Oyun Konsolu Emülatörleri
Bu makale, Linux için kullanılabilen popüler oyun konsolu öykünme yazılımını listeleyecektir. Öykünme, oyun konsollarının, komut setlerinin ve ilgili ...
Best Linux Distros for Gaming in 2021
The Linux operating system has come a long way from its original, simple, server-based look. This OS has immensely improved in recent years and has no...