Go test-writing guide that covers table-driven tests, subtests, helpers, and cmp.Diff assertions, with clear failure-message rules.

CCM score
65 of 100
skills.sh installs
1.5K
GitHub stars
197
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers table-driven tests, subtests, parallel execution, test helpers, test doubles, and cmp.Diff comparisons
  • Enforces failure messages that name the function, inputs, and got/want values, with got printed before want
  • Routes to bundled references, a scripts/gen-table-test.sh generator, and a table-test template as needed
  • Designed for writing or reviewing Go tests, and excludes benchmark performance testing (see go-performance)

Install

$ npx -y skills add cxuu/golang-skills --skill go-testing -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Go Testing

Compatibility: Diff examples may use github.com/google/go-cmp.

Resource Routing

  • scripts/gen-table-test.sh - Run when generating a table-driven test scaffold.
  • assets/table-test-template.go - Use as a copyable table-test starting point.
  • references/TABLE-DRIVEN-TESTS.md - Read when choosing table tests, subtests, or parallel test patterns.
  • references/TEST-HELPERS.md - Read when writing helpers, fixtures, cleanup, or test doubles.
  • references/TEST-ORGANIZATION.md - Read when structuring packages, black-box tests, or larger test suites.
  • references/VALIDATION-APIS.md - Read when choosing t.Error, t.Fatal, cmp.Diff, or assertion style.
  • references/INTEGRATION.md - Read when testing external services, HTTP handlers, databases, or long-running setup.

Quick Reference

Details

Repository
github.com/cxuu/golang-skills
Categories
Testing & QA, Go
First seen
May 16, 2026

More from cxuu/golang-skills

All 20

Similar to Go Testing

More Testing & QA