Getting Started with Golang

“Go is not meant to innovate programming theory. It’s meant to innovate programming practice.” – Samuel Tesla

In this article, we’ll be discussing a new and widely popular language – “Golang” We’ll be covering the following topics  –


Golang, also known as Go, is an open-source programming language created by Google in 2007. Since its invention, Go has been growing immensely over the years. Golang has a minimal syntax quite similar to other scripting. It was built to improve the productivity of the developers allowing them to write programs in a better way.

Why Golang?

  • Clean, concise and efficient
  • Minimal and
  • Built for speed (Used by companies like Google, Uber, etc)
  • Simple binaries used on the server
  • Supports Garbage collection
  • Golang is one of the


Go is anand free programming language. You can either install it via compiled binaries or build it from the source. Today, we will be installing it via the binaries available.

  • Head over to


  • Click the Download Go button and choose the binary based on your system –
    • Windows
    • Linux
    • Mac
  • I would recommend you to download the stable version, at the time I write – Go v1.14 is stable.
  • You can also install Go from source, follow the instructions

You can check if Go is installed successfully by running the following command –

go version

In case you have some doubts, All the download and installation related information is available at.

Hello World in Go

Now that we have setup Golang, we are ready to write the simplest and most famous “Hello World” program.

  • Let’s create a simple helloworld.go file. Yes, you guessed it right golang has a .go file extension.
  • Now, open up your favorite editor and copy-paste the following code.
package main import 'fmt' func main() { fmt.Println('Hello, World! I am learning Golang!') }
  • Save the file and head over to the terminal. Before some explanation. Let’s run your first Go program!
  • In the terminal (ensure you are in the same directory where you created the helloworld.go file)
go run helloworld.go

Tada! You will see the output like this –

// Output Hello, World! I am learning Golang!

Congratulations! You just ran your first go program successfully.

Let’s understand this basic code now –

  • package main – package is a keyword in Golang that defines a directory to which your file belongs. There can be only one package inside a folder. You can create multiple packages by creating multiple directories. Package is used to identify the path to your methods and variables. Here, main is a special package that is used when we are writing executable programs.
  • import 'fmt'import is again a keyword which fetches external and internal packages. Here import fetches the “fmt” package from the go library. You can use import keyword to include any package. This lets us access the Println function which is predefined in the “fmt” package. You can even check the code.
  • Then, we define our main function that gets executed automatically when we run. main() is a special type of function and it is the entry point of the executable programs. So, when we run our code – this function gets executed.In main() we simply call Println(arg)which prints the string passed to it on the terminal.
func main() { fmt.Println('Hello, World! I am learning Golang!') }


  • Learn Go basics in the browser –
  • Little go book
  • Choose your


In this tutorial, you got an introduction to Golang and how to get started with it. We installed Go on our system and ran a “Hello World” program. The next steps from here would be to learn some basics around variables, looping, and functions in Golang. You can even try running programs in the browser at.

Hope you learned something new!