What problem does it solve?
Prevents common Go mistakes that cause runtime panics, concurrency hazards, and subtle silent data corruption—especially around nils, slicing/appending, maps, numeric narrowing, and resource lifecycles.
Core Features & Use Cases
- Nil-safety patterns: Avoid typed-nil traps in interfaces/errors, guard nil pointer receivers and nil function fields, and design zero-value-safe APIs with lazy initialization.
- Slice & map safety: Prevent append aliasing/caller-slice corruption, avoid subslice backing-array retention, and ensure maps are not accessed concurrently without synchronization.
- Defensive correctness checks: Enforce bounds before integer narrowing, avoid float equality pitfalls with epsilon comparisons, and prevent
defer-in-loops resource accumulation (HTTP bodies, files, DB connections).
Use case: Reviewing a Go service that sometimes panics under edge inputs (nil configs, empty callbacks) or shows unexplained data corruption after “safe” slice operations—this skill provides targeted guardrails and review checklists to make the code robust.
Quick Start
Ask an AI coding agent to review a specific Go code path (e.g., an HTTP upload handler and its storage helpers) specifically for nil-safety, slice/map aliasing risks, numeric narrowing, float comparison, and defer-in-loop issues, then propose concrete fixes.