]> Cypherpunks repositories - gostls13.git/commitdiff
spec: reject top-level init names
authorRuss Cox <rsc@golang.org>
Mon, 11 Feb 2013 12:46:39 +0000 (07:46 -0500)
committerRuss Cox <rsc@golang.org>
Mon, 11 Feb 2013 12:46:39 +0000 (07:46 -0500)
Fixes #4586.

R=golang-dev, remyoudompheng, r
CC=golang-dev
https://golang.org/cl/7307082

doc/go_spec.html

index f18585a2e9c3d9b1fa3e94f0a86fc52e2b900749..aa4330d420bac9724acc1dea76a3929cd25862d7 100644 (file)
@@ -1,6 +1,6 @@
 <!--{
        "Title": "The Go Programming Language Specification",
-       "Subtitle": "Version of February 9, 2013",
+       "Subtitle": "Version of February 11, 2013",
        "Path": "/ref/spec"
 }-->
 
@@ -5472,8 +5472,10 @@ func init()
 </pre>
 <p>
 defined in its source.
-A package may contain multiple
-<code>init</code> functions, even
+A package-scope or file-scope identifier
+with name <code>init</code> may only be
+declared to be a function with this signature.
+Multiple such functions may be defined, even
 within a single source file; they execute
 in unspecified order.
 </p>