2 ms·
Yes, but it's pretty central to go. If code is posted somewhere for review/comment "Why doesn't this work?", often the first comments is run gofmt on it first.
by sliken 9y ago
Yes, but it's pretty central to go. If code is posted somewhere for review/comment "Why doesn't this work?", often the first comments is run gofmt on it first.
It's generally expected that all commits to code are in the gofmt standard, and there's not even the option to change the format.
I suspect if you analyzed all the code on github that go would have much higher compliance with the gofmt standard that you'd find to any other single standard for java or c++.
Gofmt is pretty nice, I wouldn't make the same decisions myself, but it's pretty valuable to have all code I see with exactly the same formatting. Additional gofmt uses the same parse as the language and can even parse, modify, and invert to produce a new source file. Similarly it's much easier to write a golang aware editor than most other languages.