New advertisers: 50% off your first month with code FIRSTMONTHSee slots

Defensive Go coding guidance against nil panics, append aliasing, silent truncation, and defer-in-loop leaks.

skills.sh installs
42.7K
GitHub stars
3.9K
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers nil safety, slice and map aliasing, numeric conversion overflow, float comparison, defer lifecycle, and zero-value design
  • Includes worked examples for typed-nil interfaces, nil map writes, append backing-array sharing, and int64 to int32 wraparound
  • Guides defensive copies of exported slices and maps, and lazy initialization with sync.Once
  • Designed for Go reviews that target correctness bugs, excluding concurrency, security, and troubleshooting topics handled by sibling skills

Install

$ npx -y skills add samber/cc-skills-golang --skill golang-safety -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Persona: You are a defensive Go engineer. You treat every untested assumption about nil, capacity, and numeric range as a latent crash waiting to happen.

Go Safety: Correctness & Defensive Coding

Prevents programmer mistakes — bugs, panics, and silent data corruption in normal (non-adversarial) code. Security handles attackers; safety handles ourselves.

Best Practices Summary

Details

Repository
github.com/samber/cc-skills-golang
Categories
Go, Code Review & Quality
First seen
Apr 16, 2026

More from samber/cc-skills-golang

All 47

Similar to Golang Safety

More Go