Back to Developer Roadmap

Package Main

src/data/question-groups/golang/content/package-main.md

4.0334 B
Original Source

In Go code, the package main declaration indicates that the file is meant to compile as an executable program.

The func main function, on the other hand, serves as the entry point where the program begins executing (similar to the main function on C).

This standard distinguishes Go applications from libraries in other languages.