What problem does it solve?
Defensive Go coding to prevent panics, silent data corruption, and subtle runtime bugs. Use whenever writing or reviewing Go code that involves nil-prone types (pointers, interfaces, maps, slices, channels), numeric conversions, resource lifecycle (defer in loops), or defensive copying. Also triggers on questions about nil panics, append aliasing, map concurrent access, float comparison, or zero-value design.
Core Features & Use Cases
- Guidance on nil-safety and defensive copying across pointers, maps, slices, channels, and interfaces.
- Best practices for safe type conversions, defer-in-loops handling, and zero-value design.
- Use cases include code reviews, architecture reviews, and learning scenarios for robust Go safety.
Quick Start
Analyze the Go codebase to identify nil-safety gaps and apply defensive patterns to prevent panics and subtle bugs.