Commit 0a22018d authored by Russ Cox's avatar Russ Cox

spec: reject top-level init names

Fixes #4586.

R=golang-dev, remyoudompheng, r
CC=golang-dev
https://golang.org/cl/7307082
parent a801c881
<!--{
"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>
......
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