]> Cypherpunks repositories - gostls13.git/commitdiff
spec: clarify text on init functions
authorRobert Griesemer <gri@golang.org>
Fri, 26 Aug 2016 04:01:17 +0000 (21:01 -0700)
committerRobert Griesemer <gri@golang.org>
Fri, 26 Aug 2016 06:10:32 +0000 (06:10 +0000)
For #16874.

Change-Id: I2e13f582297606e506d805755a6cfc1f3d4306a2
Reviewed-on: https://go-review.googlesource.com/27817
Reviewed-by: Rob Pike <r@golang.org>
doc/go_spec.html

index 75dc2e4634e68aaef40f767d3d19ab811e3f9868..77ece54d521b6820bf78588cbc6ce075c08660df 100644 (file)
@@ -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"
 }-->
 
@@ -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>