Skip to content

Commit

Permalink
spec: clarify text on init functions
Browse files Browse the repository at this point in the history
For #16874.

Change-Id: I2e13f582297606e506d805755a6cfc1f3d4306a2
Reviewed-on: https://go-review.googlesource.com/27817
Reviewed-by: Rob Pike <r@golang.org>
  • Loading branch information
griesemer committed Aug 26, 2016
1 parent 2eb46e8 commit a656390
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions doc/go_spec.html
@@ -1,6 +1,6 @@
<!--{
"Title": "The Go Programming Language Specification",
"Subtitle": "Version of August 24, 2016",
"Subtitle": "Version of August 26, 2016",
"Path": "/ref/spec"
}-->

Expand Down Expand Up @@ -2320,7 +2320,7 @@ <h3 id="Composite_literals">Composite literals</h3>

<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>

Expand Down Expand Up @@ -6162,9 +6162,10 @@ <h3 id="Package_initialization">Package initialization</h3>
</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>
Expand Down

0 comments on commit a656390

Please sign in to comment.