Il giorno martedì 13 dicembre 2016 18:13:08 UTC+1, [email protected] ha 
scritto:
>
> On Tuesday, 13 December 2016 11:34:24 UTC-5, Jan Mercl wrote:
>>
>> On Tue, Dec 13, 2016 at 5:19 PM Manlio Perillo <[email protected]> 
>> wrote:
>>
>> > However I think that there is no reason why a "main" package should not 
>> be importable, to the point that
>> > I think that the fact that a "main" package is not importable is an 
>> "exception" implemented in the Go tool.
>>
>> The package dependency graph must be (1) an acyclic graph, ie. a tree 
>> with (2) main package at its root, for obvious reasons. Importing main 
>> violates both of the properties.
>>
>
> Packages named main are importable, just like any other.  Occasionally 
> this is useful when you want to write tests for members of that package. 
>  Of course, the main function is not exported.
>
>
You are right, thanks!
For some reason I was sure it was not possible; was this feature always 
available?

This will make the implementation of my data fixture loader much more easy.


Manlio 

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to