Skip to content

Glossary: Go Basics

main function

Also written: func main, package main

The function called `main` in `package main`, which Go runs when the program starts. A program without one fails with `function main is undeclared in the main package`.

Where the book teaches it