How to install GO language on Ubuntu 18.04?

0
256
GO Language
GO Language

The world of software development is a complex world. Every day new and better features emerge that force developers to broaden their range of knowledge. However, not all these technologies are complex to assimilate, and for this purpose, I will teach you how to install GO language in Ubuntu 18.04.

Go is an open source (BSD license) programming language that was born with the objective of allowing the creation of efficient and easily distributable applications. So, it has binaries for Windows, Mac OS and of course, for Linux.

So, in this post, I will install it and create a “Hello World” file for the test.

1. Install GO Language

The installation of GO is quite simple, just download the binaries and move them to the preferred location. Of course, you can also check that the installation is correct through the key.

So, install wget package.

Then, download GO binaries.

1.- Downloading GO
1.- Download and install GO

Note: At the time of writing this post the latest stable version of GO is 1.11.4.

Now, it is necessary to decompress the file.

Next, Next, change the owner of the folder and move it to /usr/local/.

2.- Moving the binaries to the recommended path
2.- Moving the binaries to the recommended path

Many people prefer to change the route to another, but the recommended one is /usr/local/.

2. Working with the paths

Now you need to make some adjustments to your GO routes. For example, set Go’s root value, which tells Go where to look for its files.

At he end of the file add the following:

Note: These parameters work if GO was installed in the personal folder. If this is not the case, you must specify the paths.

In this case:

Setting the paths
3.- Setting the paths

Now, for the changes to take effect, it is necessary to refresh your bash profile.

4.- Refreshing the bash profile
4.- Refreshing the bash profile

Check the GO version installed.

Checking the GO version
5.- Checking the GO version

3. Creating a Hello World file

Now to check that everything is OK, you need to create a GO file and run it.

First, create the GO workspace. Don’t worry, it is a folder. I will call it work. Look at the above image.

Creating the workspace for GO
6.- Creating the workspace for GO

Then, create the first GO file.

Now, add these lines.

Creating the hello world file
7. Creating the hello world file

Now, compile the file, install the package generated and then run it.

Running the file
8.- Running the file

And that’s it.

Conclusion

GO is a very popular language and every day it is more and more popular. It’s simple but very powerful, besides being open source. As you have seen, its installation is really simple.

Please share this article in your social networks.

You can also read “How to install Ruby on Rails on Debian 9“.

Spread the love
  • 16
    Shares

PS. If you like this post please share it with your friends on the social networks using the buttons above.Thanks.

LEAVE A REPLY

Please enter your comment!
Please enter your name here