Modern Go patterns — error handling, concurrency, structured logging with slog, and Go 1.22+ features agents miss.
/add-plugin go-best-practices
/plugin install go-best-practices
npx skills add ofershap/go-best-practices/go-best-practicesOr copy skills/ into your .cursor/skills/ or .claude/skills/ directory.
- go-best-practices - Modern Go patterns — error handling, concurrency, structured logging with slog, and Go 1.22+ features agents miss
- best-practices - Always-on rules that enforce current Go patterns
/audit- Scan your codebase for Go anti-patterns
AI agents are trained on data that includes outdated Go patterns. This plugin ensures your agent uses current best practices:
- Pre-1.22 Go — Agents generate C-style for loops and unnecessary loop variable shadow copies. Go 1.22+ has range over int and fixed capture.
- log.Printf instead of slog — Structured logging with slog has been standard since Go 1.21. Agents still use the legacy log package.
- Bare error propagation — Agents return
errwithout wrapping. Errors need context at each level for debugging. - Goroutine leaks — Agents spawn goroutines without exit paths. Leaked goroutines consume memory indefinitely.
- Wrong error checks — Agents use
==or type assertion. Wrapped errors requireerrors.Isanderrors.As.
MIT