Go Control Structures

Catches Go's classic range/break/defer-in-loop footguns during code review.

Tested · Works

Test report

Verdict
Tested · Works
Score
8.8/10
Tested
Jul 16, 2026
Environment
Claude Code 2.x (agent harness)
Upstream re-checked
Aug 10, 2026 · eb59fc8

Reviewed a 3-bug Go file (range-pointer trap, defer-in-loop leak, break-only-exits-switch) both with and without the skill: both passes caught all 3 bugs, but the skill-guided pass named each pitfall by its canonical category and explicitly confirmed the absence of the other two rule categories (range-copy mutation, map-iteration hazards) — a checklist-style completeness guarantee the freeform baseline review didn't offer.

Scored on four weighted criteria — install, triggering, output vs. baseline, docs. How scoring works

  • Installs cleanly 5/5
  • Triggers reliably 5/5
  • Output vs. baseline 7/10
  • Docs & honesty 5/5

What Go Control Structures does

A reference checklist for four recurring Go control-flow bugs: mutating range loop copies instead of the original, storing a pointer to the range variable (all entries end up pointing at the last element), break only exiting the innermost switch/select instead of the loop, and defer inside a loop not firing until the function returns. Triggers when writing or reviewing Go code that ranges over slices/arrays/maps/channels, uses break inside switch/select nested in a loop, or places defer inside a loop body.

How to install Go Control Structures

git clone https://github.com/v0lka/skills
mkdir -p ~/.claude/skills
cp -r skills/development/idiomatic-go/go-control-structures ~/.claude/skills/go-control-structures

Skills live in ~/.claude/skills/ (global) or .claude/skills/ (per-project). Restart Claude Code after installing.

Commands — how to trigger Go Control Structures

  • /go-control-structures Catches Go's classic range/break/defer-in-loop footguns during code review.

It also activates on plain-language prompts like these:

  • Review this Go code for range-variable capture and defer-in-loop bugs
  • Does this break statement actually exit the loop or just the switch?
  • Check my Go function for classic loop and defer footguns before I ship

Frequently asked questions

Is the Go Control Structures skill free?
Yes. The skill itself is free from v0lka/skills. SkillProof publishes the install command and an independent test verdict at no cost.
Does Go Control Structures work with Claude Code?
We tested it with Claude Code 2.x (agent harness) on Jul 16, 2026. Verdict: Tested · Works. Reviewed a 3-bug Go file (range-pointer trap, defer-in-loop leak, break-only-exits-switch) both with and without the skill: both passes caught all 3 bugs, but the skill-guided pass named each pitfall by its canonical category and explicitly confirmed the absence of the other two rule categories (range-copy mutation, map-iteration hazards) — a checklist-style completeness guarantee the freeform baseline review didn't offer.
What is the Go Control Structures SkillProof Score?
8.8/10 — installs cleanly 5/5, triggers reliably 5/5, output vs. baseline 7/10, docs & honesty 5/5.
How do I install Go Control Structures?
Copy the install command from this page, run it in your terminal, and restart Claude Code. Skills live in ~/.claude/skills/ (global) or .claude/skills/ inside a project.
Can I use Go Control Structures with Cursor, Copilot, Gemini CLI, Codex or other AI tools?
The SKILL.md format is native to Claude (Claude Code, Desktop, claude.ai). The instructions inside adapt to other assistants: Cursor rules, GitHub Copilot instructions, Windsurf rules, Custom GPTs, AGENTS.md for OpenAI Codex, and GEMINI.md for Google Gemini CLI — our conversion guides cover each, and the free converter on the tools page does the wrapping for you.