Is it allowed to import init "mypkg" ? 2013/2/9, rsc@golang.org <rsc@golang.org>: > Reviewers: golang-dev_googlegroups.com, > ...
12 years, 10 months ago
(2013-02-09 19:09:12 UTC)
#2
Is it allowed to
import init "mypkg" ?
2013/2/9, rsc@golang.org <rsc@golang.org>:
> Reviewers: golang-dev_googlegroups.com,
>
> Message:
> Hello golang-dev@googlegroups.com,
>
> I'd like you to review this change to
> https://code.google.com/p/go/
>
>
> Description:
> spec: reject top-level init names
>
> Fixes issue 4586.
>
> Please review this at https://codereview.appspot.com/7307082/
>
> Affected files:
> M doc/go_spec.html
>
>
> Index: doc/go_spec.html
> ===================================================================
> --- a/doc/go_spec.html
> +++ b/doc/go_spec.html
> @@ -5475,6 +5475,9 @@
> <code>init</code> functions, even
> within a single source file; they execute
> in unspecified order.
> +A package must not contain package-level constants
> +or variables named <code>init</code>, nor functions
> +named <code>init</code> without the required signature.
> </p>
> <p>
> Within a package, package-level variables are initialized,
>
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "golang-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-dev+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
On Sat, Feb 9, 2013 at 2:09 PM, Rémy Oudompheng <remyoudompheng@gmail.com>wrote: > Is it allowed ...
12 years, 10 months ago
(2013-02-09 19:12:00 UTC)
#3
On Sat, Feb 9, 2013 at 2:09 PM, Rémy Oudompheng
<remyoudompheng@gmail.com>wrote:
> Is it allowed to
> import init "mypkg" ?
>
No, thanks. I'll add that.
Russ
https://codereview.appspot.com/7307082/diff/9002/doc/go_spec.html File doc/go_spec.html (right): https://codereview.appspot.com/7307082/diff/9002/doc/go_spec.html#newcode5482 doc/go_spec.html:5482: nor packages imported as <code>init</code>. you could say what ...
12 years, 10 months ago
(2013-02-09 21:10:47 UTC)
#5
Issue 7307082: code review 7307082: spec: reject top-level init names
(Closed)
Created 12 years, 10 months ago by rsc
Modified 12 years, 10 months ago
Reviewers:
Base URL:
Comments: 1