correct:
if(true) {
}
incorrect:
if(true)
{
}
Why is this style enforced, does it have something to do with
It has to do with the Spec, i.e. it's not just something they built into their compilers
Semicolons
The formal grammar uses semicolons ";" as terminators in a number of productions. Go programs may omit most of these semicolons using the following two rules:
When the input is broken into tokens, a semicolon is automatically inserted into the token stream at the end of a non-blank line if the line's final token is
- an identifier
- an integer, floating-point, imaginary, rune, or string literal
- one of the keywords break, continue, fallthrough, or return
- one of the operators and delimiters ++, --, ), ], or }
To allow complex statements to occupy a single line, a semicolon may be omitted before a closing ")" or "}".
To reflect idiomatic use, code examples in this document elide semicolons using these rules.
As far as I grasped it from their talks, they wanted to get rid of formatting-discussions and extended the idea with the greation of gofmt