How To Print Hello World in Go

Everyone starts at some point to learn something new. However, this concept is valid and invalid for programmers,  learning new languages. As every time learn a new programming language, the ritual of writing the first Hello World program remains the same. So it’s always a great thing to start learning any new programming language with a hello world program. Therefore today we’ll start the journey of Go programming. By learning how to print Hello World in Go.

One of the easiest and simple programs, you’ll ever write in Go. The reason is that whatever program you’ll write next is going to be a level up than this one.

 

What’s The Approach?

 

  • Firstly, import the “fmt” library. After that, create a main function.

 

  • Write a print statement by, passing the string Hello World.

 

Also Read: How To Install Go On Windows 11

 

Go Program To Print Hello World

 

Output:

Hello World

 

package main

import "fmt"

// Main function
func main() {

    fmt.Println("Hello World")
}

 

Ethix

I'm a coding geek interested in cyberspace who loves to write and read

Leave a Reply

Your email address will not be published. Required fields are marked *