GO Program to print “Hello World”

How to display “Hello World!”

Here we are explaining how to write a Go program to display “Hello World!” on the screen. We can use the built-in function fmt.println() to print the string "Hello World". This function is defined under the fmt package and it helps to write a standard output. In order to use these functions we need to import the “fmt” package.


How to display “Hello World!” is implemented in GO Program

We are using fmt.println() function for printing the string to output screen. Given below are the steps which are used in the Go program to print the string. 


STEP 1: Import the package fmt

STEP 2: Start function main()

STEP 3: Display the text "Hello World!" first using fmt.println()

GO Source Code

                                          package main
import "fmt"

func main() {
    fmt.Println("Hello World")


Hello World