c7e61565c09322978f8194824ec932c6010de77e
794 lines, 35+ patterns across 9 topics with hyperlinked sources. Includes frequency data from the source (281 interfaces, 55 sentinels, 262 constructors, 309 context-accepting functions, 2685 t.Helper calls). Topics: interfaces, errors, testing, packages, concurrency, documentation, naming, configuration, extension, performance, smells. All examples are real code from the Go source, not invented.
Go Patterns
Idiomatic Go patterns extracted from the Go standard library source code with verified file:line citations.
Structure
patterns/— Go stdlib patterns (interfaces, errors, concurrency, structs, testing, docs, style, API conventions, packages)smells/— Anti-patterns and common Go mistakeschangelog/— Daily digest of merged Go PRs
Philosophy
These rules are derived from what the Go standard library actually does, not opinions or blog posts. Every pattern cites specific files and line numbers.
When unsure how to do something in Go, look at how the standard library does it.
Languages
Markdown
100%