3 ms·
(Cockroach Labs co-founder here) The source files contain tab characters (gofmt enforces this for all go projects). We configure our editors to render tabs as t
by bdarnell 10y ago
(Cockroach Labs co-founder here) The source files contain tab characters (gofmt enforces this for all go projects). We configure our editors to render tabs as two spaces. There's no deep reason for this; we've just gotten used to two-space indents from our time at Google and other projects that used this convention.
Since Go code is formatted with tabs, you can mostly get away with setting the indentation to whatever you want. The one practical problem with letting people choose their own values for the width of a tab is that it becomes tricky to enforce a uniform line length, so we've standardized on two-space indents (and 100-char line lengths) across the project.
- johnnydoebk 10y agoThanks, now I see those are tabs. I didn't know Github indentation style is customizable. Interesting.