1
0
mirror of https://github.com/golang/go synced 2024-11-22 02:54:39 -07:00

spec: reject top-level init names

Fixes #4586.

R=golang-dev, remyoudompheng, r
CC=golang-dev
https://golang.org/cl/7307082
This commit is contained in:
Russ Cox 2013-02-11 07:46:39 -05:00
parent a801c8813d
commit 0a22018d46

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