Hacker News new | ask | show | jobs
by kilburn 4666 days ago
Yes, but you shouldn't ever see single-line ifs in go, because gofmt forces all of them to be multi-line.

This is one of the strong points of go (whether you like it or hate it): gofmt imposes the same formatting rules for everyone using the language. It's not a choice for you (or your project) to make. Period.

1 comments

It's easy enough to never run gofmt, so there is still a choice. :) In fact, not running gofmt requires less effort than running it.
Not if you install the (excellent) GoSublime plugin in Sublime, it will run gofmt on every save.
Learning to use some newfangled editor and figuring out how to install plugins for it when the editor you've always used works just fine sounds like much more work than running gofmt. :)