golang-safety
Helps Go developers avoid accidental bugs and panics like nil map writes, typed-nil interfaces, append aliasing, silent integer truncation, and defer-in-loop resource leaks through defensive coding pr
What it does
Defensive Golang coding against accidental bugs — nil panics, typed-nil interfaces, `append` backing-array aliasing, silent int64-to-int32 truncation, float `==` comparison, `defer` inside loops, defensive copies of slices and maps, and usable zero values. Use when a Go program panics on a nil map write or nil pointer dereference, when reviewing code for nil-safety, numeric conversion overflow, or resource lifecycle, or when designing a type whose zero value must be safe. Not for designing concurrent access with goroutines, channels, or sync primitives (→ See `samber/cc-skills-golang@golang-concurrency` skill), not for exploitable vulnerabilities such as injection, weak crypto, or leaked secrets (→ See `samber/cc-skills-golang@golang-security` skill), and not for debugging an already-failing program (→ See `samber/cc-skills-golang@golang-troubleshooting` skill).
Quality judgment
Excellent coverage of Go safety pitfalls with correct, well-commented good/bad examples, a behavior table, common-mistakes table, and precise trigger/description boundaries with cross-references to sibling skills. Minor deductions for a few unverifiable claims (reflect.TypeAssert in Go 1.25) and reliance on external reference files not shown.