Commit a656390b authored by Robert Griesemer's avatar Robert Griesemer

spec: clarify text on init functions

For #16874.

Change-Id: I2e13f582297606e506d805755a6cfc1f3d4306a2
Reviewed-on: https://go-review.googlesource.com/27817Reviewed-by: default avatarRob Pike <r@golang.org>
parent 2eb46e8c
<!--{
"Title": "The Go Programming Language Specification",
"Subtitle": "Version of August 24, 2016",
"Subtitle": "Version of August 26, 2016",
"Path": "/ref/spec"
}-->
......@@ -2320,7 +2320,7 @@ days := [...]string{"Sat", "Sun"} // len(days) == 2
<p>
A slice literal describes the entire underlying array literal.
Thus, the length and capacity of a slice literal are the maximum
Thus the length and capacity of a slice literal are the maximum
element index plus one. A slice literal has the form
</p>
......@@ -6162,9 +6162,10 @@ func init() { … }
</pre>
<p>
Multiple such functions may be defined, even within a single
source file. The <code>init</code> identifier is not
<a href="#Declarations_and_scope">declared</a> and thus
Multiple such functions may be defined per package, even within a single
source file. In the package block, the <code>init</code> identifier can
be used only to declare <code>init</code> functions, yet the identifier
itself is not <a href="#Declarations_and_scope">declared</a>. Thus
<code>init</code> functions cannot be referred to from anywhere
in a program.
</p>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment