# Golang Development

> You MUST activate this skill when working on Go projects

- Skill: `sammcj/golang-development` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add sammcj/golang-development`
- Raw SKILL.md: https://api.skillmd.com/api/skills/sammcj/golang-development/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: sammcj (https://skillmd.com/u/sammcj)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/sammcj/golang-development

---


# Go

- Use latest Go version (verify, don't assume). Build with `-ldflags="-s -w"`
- Check modernity: `go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -fix -test ./...`
- Copy golangci config: `$HOME/git/sammcj/mcp-devtools/.golangci.yml`
- Idiomatic Go: explicit error handling, early returns, small interfaces, composition, defer for cleanup, table-driven tests

## Go Testing

- When working with tests in Go, read in `references/go-testing.md` for actionable testing guidelines.

