Learn / Go / Your first Go program

Go, lesson 1 of 4

Your first Go program

Go is a fast, simple language built at Google and used for cloud tools, servers and command-line programs. Unlike Python, Go is compiled: our server turns your code into a program and runs it, then shows you what it printed.

Every Go program is in a package, starts at func main, and prints with fmt.Println:

package main
import "fmt"
func main() {
    fmt.Println("Hello, LearnOfficially")
}

import "fmt" brings in the formatting package. Go is strict: import something you do not use and it will not compile.

Your turn

Make the program print exactly Hello, LearnOfficially.

Press Run to see what your code prints.