1
0
mirror of https://github.com/golang/go synced 2024-09-24 13:20:12 -06:00

doc: update Effective Go init section

Goroutines are no longer excluded from init.

Fixes #3232.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5764044
This commit is contained in:
Russ Cox 2012-03-07 11:38:39 -05:00
parent 318465b52a
commit e8d1852d6a

View File

@ -1761,10 +1761,7 @@ var (
<p>
Finally, each source file can define its own niladic <code>init</code> function to
set up whatever state is required. (Actually each file can have multiple
<code>init</code> functions.) The only restriction is that, although
goroutines can be launched during initialization, they will not begin
execution until it completes; initialization always runs as a single thread
of execution.
<code>init</code> functions.)
And finally means finally: <code>init</code> is called after all the
variable declarations in the package have evaluated their initializers,
and those are evaluated only after all the imported packages have been