
Golang Safety
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
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,
appendbacking-array sharing, andint64toint32wraparound - 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 -yInstalls 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- Golang Project Layout42.5K
- Golang Documentation42.4K
- Golang Modernize42.4K
- Golang Lint42.3K
- Golang Data Structures42.3K
- Golang Troubleshooting42K
- Golang Observability42K
- Golang Dependency Management41.8K
- Golang Structs Interfaces41.7K
- Golang Cli41.5K
- Golang Benchmark41.5K
- Golang Dependency Injection41.4K
- Golang Popular Libraries41.4K
- Golang Stretchr Testify41.3K
- Golang Continuous Integration41.3K
- Golang Grpc41.1K
- Golang Samber Lo40.4K
- Golang Stay Updated40.3K
- Golang Samber Do40.2K
- Golang Samber Slog40.1K
- Golang Samber Oops40K
- Golang Samber Mo40K
- Golang Samber Hot40K
- Golang Samber Ro39.9K
Similar to Golang Safety
More Go
golang-data-structuressamber/cc-skills-golang42.3K installsReference guide covering Go slices, maps, arrays, container packages, generics, and pointer types with selection guidance.
golang-design-patternssamber/cc-skills-golang44.3K installsIdiomatic Go design patterns covering constructors, error flow, lifecycle, and architecture choices for production code.
go-defensivecxuu/golang-skills1.3K installsHardening patterns for Go API boundaries covering copies, defer cleanup, crypto rand, and robustness review.
go-data-structurescxuu/golang-skills1.3K installsGo slice, map, and array idioms covering nil versus empty slices, append, sets, and copy safety.
go-code-reviewexistential-birds/beagle205 installsStructured Go review skill that checks idiomatic patterns, error handling, concurrency safety, and version-gated advice from go.mod.