Programming Languages Section

Go

Card image
Post by Amina Delali, December 21th,2020

Some Facts

The Go (Golang) is an open source compiled language. It implements concurrency mechanisms, and static typing.
So it is a multi-paradigm language: concurrent, functional, imperative and object oriented.

It is compiled to native machine code, and can be used for system and network programming, big data and machine learning, as well as for audio and video editing.
To create GUIs with Go you have to use dedicated packages: web-based and desktop based ones.



How to install it

To install go on your computer, you have first to download the installer corresponding to your operating system from the golang page.
Then you will have to follow the related instructions of installation that are described in that same page

On Ubuntu: Extract the downloaded installer in /usr/local folder. Just type the following tar command

sudo tar -C /usr/local -xzf name-of-the-version.tar.gz

A new folder will be created : /usr /local/go. Add that path to your PATH environment variable by inserting the export path line to one of the two following files : $HOME/.profile or etc/profile file.
Let's say that you will edit the second one. You can use the nano command:

sudo nano /etc/profile

add the following line into the file.:

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

After saving the changes, and exiting nano, you can apply the changes and check the go version with the following commands:

source /etc/profile

But you will have to log out, and log in again to your user account, to make the changes permanent.Then check the installed version of go:

go version

This being said, there is an other way to install the language without downloding the archive from the website. Just install the snap version:

sudo snap install go --classic

On Windows 10: just follow the instructions of the installer. After the installation, open a new command prompt window, and type in the following:/p>

go version

Something to say ?

If you want to add something about the Go language or about this post, please feel free to do it by commenting below 🙂 .