Go (Golang) Cursor Rules — Patterns AI Models Get Wrong
A terse, opinionated .cursor/rules file that stops Cursor, Claude Code, Windsurf, and Copilot from writing Go that compiles clean and misbehaves at runtime — for developers writing Go with an AI coding agent.
Description
The catalog's first Cursor Rules product: 24 specific, named Go bugs an AI coding agent routinely introduces because they compile without error — the typed-nil-in-an-interface trap, sync.WaitGroup.Add() called from inside the goroutine it tracks, unbuffered channel sends with no receiver, Go 1.22's loop-variable scoping change (and when the old per-iteration-copy workaround is dead code vs. still required), errors.Is/errors.As vs. ==, generic constraint mistakes (comparable vs. cmp.Ordered), and more. Delivered as a single 252-line RULES.md with install instructions for Cursor's .cursor/rules format plus Claude Code, Windsurf, and Copilot, and a grep-based pre-commit scan at the end.
What's included
- RULES.md — 252-line Go rules file: module version discipline, error handling, interfaces/nil, goroutines/concurrency, slices/maps/defer, context, JSON/structs, generics, testing, strings/performance, program exit, plus a quick pre-commit grep scan
- README.md — installation for Cursor (.cursor/rules), Claude Code, Windsurf, and GitHub Copilot, plus what this does not do (scope boundaries vs. go vet/staticcheck/golangci-lint)
Delivery
Instant download after Stripe checkout. File: nightforge-go-cursor-rules.zip