Rodin
52503d24c2
fix: update drifted file:line citations to match current golang/go source
...
Audited all file:line citations against golang/go HEAD.
97 citations checked; 9 had drifted by 1-20 lines (off-by-one or small
structural shifts in the stdlib source). Updated both inline code block
comments and corresponding GitHub #L anchor links.
Changes per file:
patterns/api-conventions.md - strings/builder.go WriteString (92→112), String (48→46)
patterns/configuration.md - crypto/tls/common.go Time field (572→575)
patterns/documentation.md - net/http/server.go Handler comment (64→65), os/file.go example (17→16)
patterns/structs.md - os/types.go File struct (16→15), strings/builder.go copyCheck (25→32)
patterns/style.md - net/http/server.go TLSConfig (3041→3040), import block (8→9)
2026-05-06 17:17:20 -07:00
aweiker
eb9171368b
docs: add 'when to use' triggers + examples to all patterns
...
Added 'When to Use' subsections with concrete decision triggers and
before/after Go code examples to patterns across all directories:
- patterns/error-handling.md (3 patterns: sentinels, wrapping, Join)
- patterns/concurrency.md (4 patterns: Mutex, Once, done channels, pipelines)
- patterns/interfaces.md (4 patterns: small interfaces, accept/return, adapter, optional)
- patterns/structs.md (3 patterns: zero-value, constructors, config structs)
- patterns/package-design.md (3 patterns: internal/, init(), context keys)
- patterns/style.md (3 patterns: interface checks, iota constants, named types)
- patterns/testing-advanced.md (3 patterns: table tests, golden files, httptest)
- patterns/api-conventions.md (3 patterns: Must, layered API, graceful shutdown)
- patterns/documentation.md (2 patterns: examples, deprecated)
- kubernetes/patterns.md (3 patterns: controller, workqueue, leader election)
- kubernetes/production-go.md (2 patterns: codegen, HandleCrash)
- smells/anti-patterns.md (2 anti-patterns: cache mutation, edge-triggered)
2026-04-30 12:08:41 +00:00
Rodin
0f1d7e4c06
feat: initial Go patterns guide from stdlib + Kubernetes source study
...
9 pattern files covering stdlib (structs, interfaces, API conventions, docs, style),
Kubernetes (controller/reconciler, informer/cache, leader election, code generation),
comparison (stdlib vs K8s approaches), and anti-patterns.
All patterns cite exact source files and line numbers.
2026-04-30 06:34:02 +00:00