>-
Production Go code patterns covering error handling, concurrency, naming, testing, and performance. Comprehensive error handling guidance: return errors instead of panicking, use error wrapping with %w for inspection and %v for boundaries, join multiple errors with errors.Join, and handle errors once at the appropriate level Concurrency best practices: unbuffered or size-1 channels, document goroutine lifetimes, prefer errgroup.Group for concurrent operations, and use typed atomics from sync/atomic Naming conventions: MixedCaps always, consistent initialisms (URL not Url), short names for limited scope, one or two-letter receiver names, and avoid repeating package names in identifiers Testing patterns: table-driven tests with parallel execution, use go-cmp for comparisons, synctest for deterministic concurrent testing (Go 1.25+), and verify interface compliance at compile time Performance tips: preallocate slices and maps with known capacity, use strings.Builder for concatenation, prefer strconv over fmt, and leverage standard library slices and maps packages Go Best Practices Production patterns from Google, Uber, and the Go team. Updated for Go 1.25. Sub-skills: skills/go-error-handling, skills/go-concurrency, skills/go-testing, skills/go-performance, skills/go-code-review, skills/go-linting, skills/go-project-layout, skills/go-security. Deep-dive references in references/. Core Principles Readable code prioritizes these attributes in order: Clarity: purpose and rationale are obvious to the reader Simplicity: accomplishes the goal in the simplest way Concision: high signal to noise ratio Maintainability: easy to modify correctly Consistency: matches surrounding codebase Error Handling
don't have the plugin yet? install it then click "run inline in claude" again.