In this tutorial, we will learn how to write a Hello World program in Go language. We will go through each statement of the program.
package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}
Hello, World!
package main
main
package is special because it defines a standalone executable program in Go.import "fmt"
fmt
package, which contains functions for formatted I/O, including printing to the console.func main()
{
fmt.Println("Hello, World!")
Println
function from the fmt
package adds a new line after the text.}