Go Hello World

In this tutorial you will learn about the Go Hello World and its application with practical example.

Go Hello World Program

The “Hello world!” program is a simplest program that will display some text on the screen. The “Hello world!” program is a simple yet complete program for beginners that illustrates the basic syntax of any programming language. The “Hello world!” program gives you a way to test systems and programming environment.

This tutorial will guide you through writing a basic “Hello, World” program in Go Programming Language.

Prerequisites

Before starting with this tutorial we assume that you already have Go installed (If you do not have Go installed then install it before you get started) as well as a local programming environment set up on your computer.

Step 1:- Create a file called “hello_world.go” using a text editor program of your choice. The .go file extension is used to specify Go language file.

Step 2:- Let’s open the “hello_world.go” file that we created, and put the following line of code in it and save it.

The Println() is a function that tells Go to display or output the content inside the parentheses.

Step 3:- Now, open terminal or command prompt and switch to the folder where our “hello_world.go” file is saved. Run the program by typing the following command –

Once the program is executed it will print “Hello, World!”.

Output:-

golang hello world

In this tutorial we have learn about the Go Hello World and its application with practical example. I hope you will like this tutorial.