Getting started with Golang

Reading Time: 3 minutes

Hello Readers! You all must have heard about Golang. So, In this blog we will see how you can set up golang in your system and after that we will see a simple demo with getting started with golang.

Here are the 4 easiest steps to get Golang up and running in your linux machine. So, let’s get started.

Step 1: First step is to download the Linux tar.gz package from Golang website. So, download the latest, and stable binary release from its website i.e :


Step 2: Next step is to unzip the tar.gz package. After that move it to the /usr/local directory.


Step 3: Next step is to add the its binary to the $PATH environment variable. You have to open your .bashrc file and paste this line there.


Step 4: Now In the same file add a variable called $GOPATH and point to where your Golang apps are going to live. After this, reload your .bashrc file.


Step 5: Test its version and Confirm that the command prints the installed version of Go.


So, Now we are all set for getting started with it.

Hello, World! is the first basic program in any programming language. Let’s write the first program in the Golang using the following steps:

First step is to open a command prompt and cd to your home directory. I will create a hello directory for my first Go source code.


Move to this directory.

Secondly you have to enable dependency tracking for your code.

Run the following command for this.


File will be created by this.


Create a file hello.go and paste the following code here.


Now, you can run the code to see the output.


Use the following command to get a list of the others:

go help


In this blog we have seen how to setup golang in your ubuntu and how to get started with it. We have also seen here a simple demo of hello world. Thanks for being with me till the end. If you find this blog helpful do share with your friends.



Written by 

Naincy Kumari is a DevOps Consultant at Knoldus Inc. She is always ready to learn new technologies and tools. She loves painting and dancing.