Re: [go-nuts] Type statement in blocks vs global

2016-11-28 Thread Jan Mercl
On Mon, Nov 28, 2016 at 12:21 PM wrote: > Since a type can only be declared once in a scope, the order in which they are declared shouldn't matter ? It matters depending on which scope it is. From https://golang.org/ref/spec#Declarations_and_scope ...

Re: [go-nuts] Type statement in blocks vs global

2016-11-28 Thread paraiso . marc
I'm not sure what you mean. types that reference each others in a type declaration are allowed when declared globally , but not in a block ( ? ) i.e. : declaring Foo and Bar outside main would work , declaring them inside main doesn't . I wanted to declare them inside an example function in

Re: [go-nuts] Type statement in blocks vs global

2016-11-28 Thread Jan Mercl
On Mon, Nov 28, 2016 at 11:46 AM wrote: > Is there an alternative aside from declaring types globally ? Unfortunately, the problem to solve is not defined, only the solution tried and failed is, so I don't know if this can help: https://play.golang.org/p/9btAagXDpM --