Defensive Golang coding against accidental bugs — nil panics, typed-nil interfaces, `append` backing-array aliasing, si…
Part of cc-skills-golangPack · 46 skills
by samber· Developer toolsUnclaimed · Yours? Claim it
About
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).
Skills people install alongside golang-safety.
Runs on your machine.
Runs on your machine.
Runs on your machine.
Runs on your machine.
npx -y degit samber/cc-skills-golang/skills/golang-safety ~/.copilot/skills/golang-safety
Runs on your machine.
npx -y degit samber/cc-skills-golang/skills/golang-safety ~/.cursor/skills/golang-safety
Runs on your machine.
npx -y degit samber/cc-skills-golang/skills/golang-safety ~/.claude/skills/golang-safety
Runs on your machine.
npx -y degit samber/cc-skills-golang/skills/golang-safety ~/.agents/skills/golang-safety
Runs on your machine.
Runs on your machine.
npx -y degit samber/cc-skills-golang/skills/golang-safety ~/.gemini/skills/golang-safety
Runs on your machine.
npx -y degit samber/cc-skills-golang/skills/golang-safety .agents/skills/golang-safety
Runs on your machine.
npx -y degit samber/cc-skills-golang/skills/golang-safety ~/.openclaw/skills/golang-safety
Runs on your machine.
npx -y degit samber/cc-skills-golang/skills/golang-safety ~/.config/opencode/skills/golang-safety
Runs on your machine.
npx -y degit samber/cc-skills-golang/skills/golang-safety ~/.hermes/skills/golang-safety
Scanned and passed · checked 49 min ago
From people who use it
Step by step
Nothing new reaches your agent until a person has looked at it.
Scanned on every change, and again when our rules improve.
No reviews yet. Used golang-safety? Say how it went.
Write a reviewTw93's engineering habits as eight skills: plan before you build, debug to root cause, review before you ship, and more.
Go skills for coding agents: idiomatic style, error handling, testing, concurrency, security and performance for production Go projects.
Test Double's coding skills: build test-first, refactor under green tests, review your branch and trace bugs to their root cause.
Nobody has shared how they use golang-safety yet.
Security scan
Passed
Safe to install in every agent it supports. Runs in your agent, as instructions.