lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

The newline rule in Go is fairly simple: the language definition uses semicolons as statement terminators, like C, but the compiler inserts them automatically if the last token on a line is one that could end a statement, e.g. literals, ")", "}", ","break", "++", etc.
You can safely break up lines after a comma, opening bracket, opening parenthesis, or operator.


On Monday, August 5, 2013, Sven Olsen wrote:
 As best as I can tell; Go's parser will throw an error anytime you do something with newlines that makes it vaguely nervousness -- effectively a much more aggressive version of the "Ambiguous syntax" error from 5.1.  And this ends up being a perpetual source of small annoyances.