What problem does it solve?
Golang-safety helps you avoid crashes and subtle data corruption caused by unsafe Go assumptions—like nil interfaces/maps, slice/map aliasing, risky numeric conversions, and incorrect resource lifecycles.
Core Features & Use Cases
- Nil-safety and typed-nil correctness: Prevents nil interface traps and nil pointer receiver/function panics by enforcing explicit nil handling patterns.
- Slice & map safety: Stops append aliasing bugs and ensures defensive copies for exported getters to protect internal state.
- Numeric & floating-point correctness: Avoids silent truncation in integer narrowing and incorrect float equality by using bounds checks and epsilon comparisons.
- Resource lifecycle correctness: Prevents
defer-in-loop accumulation issues so files, DB connections, and HTTP bodies close per-iteration.
Quick Start
Use the golang-safety skill to review your Go code for nil safety, defensive copying, numeric narrowing overflow, and defer-in-loop resource leaks.