Generally, the culture in Go is to format your code the way the command go fmt
would format it. (The reasons why there is an accepted style are in the linked article.)
To the extent that go fmt
puts structured statement bodies on separate lines means that yes, the practice is "discouraged" in the community, but only because of a desire to have a common look for as much Go source code as possible.
The reasons why one-liners are not part of go fmt
are not as relevant as the fact that go fmt
was chosen as the canonical style. If you wish to argue about the pros and cons of one-liners, you can look at the debates made in just about any curly-brace language, as they are not unique to Go. Of course, Go's mandating of braces does make the question slightly different than, say, C or Java, where unbraced bodies means it's harder to "add a new statement in the body," but basically many of the same arguments for readability do apply.