Go Formatter
Format Go code with gofmt-style tab indentation and K&R brace placement. Inspired by the official gofmt tool — the de-facto standard for Go formatting.
What is gofmt?
gofmt is Go's official code formatting tool, included with every Go installation. Unlike most languages where formatting is a matter of style guides and personal preference, Go takes an opinionated stance: all Go code should be formatted with gofmt. This eliminates formatting debates entirely. Key rules: tabs (not spaces) for indentation, opening braces on the same line, and no trailing semicolons (the compiler inserts them).
Frequently Asked Questions
gofmt enforces tabs, and Go code style discussions never include the spaces-vs-tabs debate — it's settled.implements keyword). This is called duck typing. Interfaces are used for polymorphism and testability in Go.