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
...
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
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
--