From c072558b90f1bbedc2022b0f30c8b1ac4712538e Mon Sep 17 00:00:00 2001
From: Ondřej Surý Bootstrapping
@@ -5064,8 +4991,12 @@ The importing of packages, by construction, guarantees that there can
be no cyclic dependencies in initialization.
-A complete program, possibly created by linking multiple packages,
-must have one package called main
, with a function
+A complete program is created by linking a single, unimported package
+called the main package with all the packages it imports, transitively.
+The main package must
+have package name main
and
+declare a function main
that takes no
+arguments and returns no value.
@@ -5073,20 +5004,12 @@ func main() { ... }
-defined.
-The function main.main()
takes no arguments and returns no value.
-
-Program execution begins by initializing the main
package and then
-invoking main.main()
.
-
-When main.main()
returns, the program exits. It does not wait for
-other (non-main
) goroutines to complete.
+Program execution begins by initializing the main package and then
+invoking the function main
.
-Implementation restriction: The compiler assumes package main
-is not imported by any other package.
+When the function main
returns, the program exits.
+It does not wait for other (non-main
) goroutines to complete.