Are you referring to C style if statements where you can elide the braces?
In go the braces are mandatory, so I don't think that really applies.
> One consequence of the semicolon insertion rules is that you cannot put the opening brace of a control structure (if, for, switch, or select) on the next line. If you do, a semicolon will be inserted before the brace, which could cause unwanted effects.
I was assuming that the “unwanted effects” are not just a syntax error.
Are there Go codebases that stick to the formatting you show, out of curiosity?
Either way, please file a bug. Perhaps others can chime in there if they also use the same style.
Support for allowing configuration of such a thing would be a misfeature if I was to be asked.
How is having a random newline at the top and bottom where there is already a clear separation between function signature and implementation via braces and the guide of the first indentation, helping readability?
All it does is steal valuable vertical space away from things that matter.
I'm not saying that there's never a reason for to have extra blank lines. But your example isn't it.
Maybe I'm weird but one of the greatest things about gofmt is that it doesn't murder "padded blocks", like so many formatters out there.
For example, given this
gofmt will simply collapse the double line in the middle.However, this tool will do this
How is having chunks of code smashed into the tops and bottoms of a blocks good for improving readability? Why should the visual relationship between and main() and "a" be stronger than between "b" and "c" if the author doesn't want it?