The main function
Every executable Go program has exactly one func main(). When the program starts, Go calls main and runs its statements top to bottom.
func main() {
fmt.Println("first")
fmt.Println("second")
}
Output:
first
second
Statements end with a semicolon in the grammar, but Go inserts them automatically at line breaks, so you rarely write any.
The standard library
Go ships with a large standard library. fmt handles formatted input and output. Others you will use soon:
os: operating system interactionsio: reading and writing datamath: math functions
Import them with import "package" and call their exported functions like fmt.Println.