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.

Jak używać Xdotool do stymulacji kliknięć myszą i naciśnięć klawiszy w systemie Linux?
Xdotool to darmowe i otwarte narzędzie wiersza poleceń do symulacji kliknięć myszą i naciśnięć klawiszy. Ten artykuł zawiera krótki przewodnik dotyczą...
5 najlepszych ergonomicznych myszy komputerowych dla systemu Linux
Czy długotrwałe korzystanie z komputera powoduje ból nadgarstka lub palców?? Cierpisz na sztywne stawy i ciągle musisz uścisnąć dłonie? Czy czujesz pa...
Jak zmienić ustawienia myszy i touchpada za pomocą Xinput w systemie Linux?
Większość dystrybucji Linuksa jest domyślnie dostarczana z biblioteką „libinput” do obsługi zdarzeń wejściowych w systemie. Może przetwarzać zdarzenia...