Essential Go Getting started  Edit on GitHub      File Issue

Hello, World!

Create a file hello_world.go and run it with go run hello_world.go.

package main

import "fmt"

func main() {
	fmt.Println("Hello, 世界")
}
Hello, 世界

To create an executable run go build hello_world.go -o hello_world.

On Windows this will create hello_world.exe executable.

On every other OS, this will create ./hello_world executable.

  ↑ ↓ to navigate     ↵ to select     Esc to close