There is a large number of programming languages quite diverse and varied. Some of them, with specific purposes such as the web or the desktop but others more general. What is certain is that the big companies of development and implementation of software are in the frequent search of languages of programming that adapt to the new necessities of the clients. In this sense, more and more people are talking about GO because of its speed and efficiency. In this post you will learn how to install GO language on Rocky Linux 8 /CentOS 8 / Fedora 34.
Go is a programming language created in 2007 by Google. It was initially intended to be an internal coding standard for the company’s own infrastructure, but its potential prompted it to go on the air. Go is a concurrent and compiled programming language inspired by C syntax. It has been developed by Google, and its initial designers are Robert Griesemer, Rob Pike and Ken Thompson. It is cross-platform because it has binaries for Windows, Linux, macOS,
Some of its features are:
- Go uses a syntax similar to C.
- In teh same way, Go uses statically typed and is as efficient as C.
- Go has many of the features and ease of dynamic languages like Python.
- Although it is a language designed for system programming, it provides a garbage collector, reflection and other high-level capabilities that make it a very powerful language.
Therefore we are talking about a robust, technical and efficient language. So, let us install Go language on CentOS 8.
Install GO language on Rocky Linux 8 / CentOS 8 / Fedora 34
First you have to update the system. This is always recommended for security reasons.
So open a terminal session and run the following:
:~$ su
:~# dnf update
By having the system updated, you will have the latest security patches available and your system will be more robust.
Then you have to download the corresponding binaries for our system. For this we will use a tool called wget, if you don’t have it installed, you will have to do it.
:~# dnf install wget
:~# wget https://dl.google.com/go/go1.13.1.linux-amd64.tar.gz
Versions may change over time. So check in the download section which is the latest stable version and modify the command.
Now we will have to unzip it and move it to an installation folder. In my case, I will do it in /usr/local
and unzip the file there.
:~# dnf install tar :~# tar -zxvf go1.13.1.linux-amd64.tar.gz -C /usr/local
It is now the turn to maintain the environment variables. All this so that the installation does not have problems finding the command and the compiler.
:~# echo 'export GOROOT=/usr/local/go' | tee -a /etc/profile
:~# echo 'export PATH=$PATH:/usr/local/go/bin' | tee -a /etc/profile
Finally, refresh your bash profile.
:~# source /etc/profile
Now let’s test the installation. To do this we will create the typical Hello World program. First create the folders:
:~# mkdir -p project/helloworld :~# cd project/helloworld
Then, create the new file and add the following:
:~# nano helloworld.go
package main import "fmt" func main() { fmt.Printf("Hi, I am Angelo. Welcome to osradar.com\n") }
Then, save the changes and close the file.
Now, run the program:
:~# go run helloworld.go
Yeah, everything’s fine and working. Now you can start creating great apps with Go.
Conclusion
Go is a versatile and very efficient modern programming language sponsored by Google. This makes it quite robust with a solid community behind it. Today you have learned to install it on CentOS 8 and RHEL 8.
So, please share this post with your friends and join our Telegram channel.