See Topic 2 → args / decorators — configure APIs with ...Option for backward-compatible growth.
Define small interfaces at the point of use (io.Reader, interface{ Write([]byte) (int, error) }).
Embed http.Server or config structs sparingly; prefer explicit composition for clarity.
One test function, many cases in a slice of structs — standard library style.
Return error; wrap with %w; check with errors.Is / errors.As.
Pass interfaces into constructors; use fx/wire only when complexity warrants.
//go:build linux
package main
Select files per OS or feature flags.
init runs on import; keep it minimal — global registration only when necessary.
For public modules, avoid breaking changes; add new functions or v2 path.