On Mon, Nov 28, 2016 at 12:21 PM <paraiso.m...@gmail.com> 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 """" ... 2. The scope of an identifier denoting a constant, type, variable, or function (but not method) declared at top level (outside any function) is the package block. ... 5. The scope of a type identifier declared inside a function begins at the identifier in the TypeSpec and ends at the end of the innermost containing block. """" IOW, one cannot have forward local type references inside a function. -- -j -- 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 golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.