Skip to content

Latest commit

 

History

History
28 lines (18 loc) · 795 Bytes

File metadata and controls

28 lines (18 loc) · 795 Bytes

Go Style Guide

General Formatting Rules

  • We format Go files using gofumpt, a stricter version of gofmt with additional preferences.
  • Up to 90 columns per line. You may go above (up to 97) if the line fits within that amount and it is not worth it to break the line.
  • When parentheses (such as in function calls) are wrapped on multiple lines, the closing parentheses should be on its own line (except if there are curly braces before it).

Code Organization

Sections

Separating Functions

Ordering Files

Statements

Variable Declarations

If Statements

Switch Statements

Doc Comments

Don't go above 90 columns for comments; try to go below. 80 columns may also be used for balancing lines.

Naming Conventions

Code Comments

Examples