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", "Title": "The Go Programming Language Specification",
"Subtitle": "Version of February 9, 2013", "Subtitle": "Version of February 11, 2013",
"Path": "/ref/spec" "Path": "/ref/spec"
}--> }-->
...@@ -5472,8 +5472,10 @@ func init() ...@@ -5472,8 +5472,10 @@ func init()
</pre> </pre>
<p> <p>
defined in its source. defined in its source.
A package may contain multiple A package-scope or file-scope identifier
<code>init</code> functions, even 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 within a single source file; they execute
in unspecified order. in unspecified order.
</p> </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