Package Main and fmt.Println
Every executable Go program is package main. Import fmt and call fmt.Println to print a line.
- package main is required for executables.
- import "fmt" brings in formatting helpers.
- func main() is the entry point.
package main
import "fmt"
func main() {
fmt.Println("Greetings from Golang!")
}
After you read this chapter, use Write (when available) and Quiz on this page to lock it in — same flow as C, Python, and the other Learn languages.