Here is the smallest Go program you can actually run. Paste it into a
file called main.go and it works as-is:
package main
import "fmt"
func main() {
fmt.Println("hello from Go")
}
Run it and it prints:
hello from Go
Every runnable Go program has this same shape - four parts, each
required: a package line, an import line, a func main, and the
code inside it. The next few nodes take these one at a time. For now,
notice that this whole file is a valid program you can copy, run, and
build - nothing is left out.