Agent skill

Go Testing

by cxuu in cxuu/golang-skills

A skill your agent uses when writing, reviewing, or improving Go test code — including table-driven tests, subtests, parallel tests, test helpers, test doubles, and assertions with cmp.Diff.

Apache-2.0Auto-check passedTesting & QA

Install Go Testing

skills CLI
$ npx skills add cxuu/golang-skills --skill go-testing -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install cxuu/golang-skills go-testing --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/cxuu/golang-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/go-testing .claude/skills/go-testing && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
go-testing
GitHub stars
170
Used in
1 other repo
Token cost
~1.3k tokens
SKILL.md length
490 words
Files
8 (incl. scripts, references, assets)
Skills in repo
20
Repo updated
First seen
Licence
Apache-2.0

At a glance

A skill your agent uses when writing, reviewing, or improving Go test code — including table-driven tests, subtests, parallel tests, test helpers, test doubles, and assertions with cmp.Diff.

  • Improving Go test code — including table-driven tests
  • SKILL.md covers Resource Routing, Quick Reference, Useful Test Failures and No Assertion Libraries, plus 5 more sections
  • Runs Go and Shell scripts from its folder; calls go
  • Assertions with cmp.Diff

What it does

Go Testing is an agent skill from cxuu/golang-skills. Use when writing, reviewing, or improving Go test code — including table-driven tests, subtests, parallel tests, test helpers, test doubles, and assertions with cmp.Diff. Also use when a user asks to write a test for a Go function, even if they don't mention specific patterns like table-driven tests or subtests. Does not cover benchmark performance testing (see go-performance).

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 10 other files, including scripts, reference files and assets (for example `references/INTEGRATION.md`, `references/TABLE-DRIVEN-TESTS.md` and `references/TEST-HELPERS.md`).

It sits in Testing & QA, covering Unit testing and Load testing. The repository describes itself as: AI Agent Skills for idiomatic, production-ready Go code, distilled from Google, Uber, Community. The licence is Apache-2.0.

When your agent uses it

  • Improving Go test code — including table-driven tests
  • Assertions with cmp.Diff
  • A user asks to write a test for a Go function
  • Even if they dont mention specific patterns like table-driven tests

Example prompts

  • “/go-testing”

Requirements

  • A Bash shell
  • Pre-approved tools (allowed-tools): Bash(bash:*)

What it can do on your machine

Read from SKILL.md and the folder at commit 91f0c2e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash(bash:*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Go and Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • go

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Go Testing loads about 1.3k tokens when it runs, and up to ~6.3k if it reads all its reference files. Until then it costs about 98 tokens; SKILL.md has 490 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~98
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~6.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from cxuu/golang-skills at commit 91f0c2e, republished under its Apache-2.0 licence (© cxuu). 490 words, ~1,340 tokens.

Download SKILL.mdSave it as .claude/skills/go-testing/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.
name
go-testing
description
Use when writing, reviewing, or improving Go test code — including table-driven tests, subtests, parallel tests, test helpers, test doubles, and assertions with cmp.Diff. Also use when a user asks to write a test for a Go function, even if they don't mention specific patterns like table-driven tests or subtests. Does not cover benchmark performance testing (see go-performance).
allowed-tools
Bash(bash:*)

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

PatternUse When
t.ErrorDefault — report failure, keep running
t.FatalSetup failed or continuing is meaningless
cmp.DiffComparing structs, slices, maps, protos
Table-drivenMany cases share identical logic
SubtestsNeed filtering, parallel execution, or naming
t.Helper()Any test helper function (call as first statement)
t.Cleanup()Teardown in helpers instead of defer

Useful Test Failures

Normative: Test failures must be diagnosable without reading the test source.

Every failure message must include: function name, inputs, actual (got), and expected (want). Use the format YourFunc(%v) = %v, want %v.

go
// Good:
t.Errorf("Add(2, 3) = %d, want %d", got, 5)

// Bad: Missing function name and inputs
t.Errorf("got %d, want %d", got, 5)

Always print got before want: got %v, want %v — never reversed.


No Assertion Libraries

Normative: Do not use assertion libraries. Use cmp.Diff for complex comparisons.

go
if diff := cmp.Diff(want, got); diff != "" {
    t.Errorf("GetPost() mismatch (-want +got):\n%s", diff)
}

For protocol buffers, add protocmp.Transform() as a cmp option. Always include the direction key (-want +got) in diff messages. Avoid comparing JSON/serialized output — compare semantically instead.


t.Error vs t.Fatal

Normative: Use t.Error by default to report all failures in one run. Use t.Fatal only when continuing is impossible.

Choose t.Fatal when:

  • Setup fails (DB connection, file load)
  • The next assertion depends on the previous one succeeding (e.g., decode after encode)

Never call t.Fatal/t.FailNow from a goroutine other than the test goroutine — use t.Error instead.


Show full SKILL.md (214 more words)Show less

Table-Driven Tests

See assets/table-test-template.go when scaffolding a new table-driven test and need the canonical struct, loop, and subtest layout.

Advisory: Use table-driven tests when many cases share identical logic.

Use table tests when: all cases run the same code path with no conditional setup, mocking, or assertions. A single shouldErr bool is acceptable.

Don't use table tests when: cases need complex setup, conditional mocking, or multiple branches — write separate test functions instead.

Key rules:

  • Use field names when cases span many lines or have same-type adjacent fields
  • Include inputs in failure messages — never identify rows by index

Validation: After generating or modifying tests, run go test -run TestXxx -v to verify the tests compile and pass. Fix any compilation errors before proceeding.


Test Helpers

Normative: Test helpers must call t.Helper() first and use t.Cleanup() for teardown.

go
func setupTestDB(t *testing.T) *sql.DB {
    t.Helper()
    db, err := sql.Open("sqlite3", ":memory:")
    if err != nil {
        t.Fatalf("Could not open database: %v", err)
    }
    t.Cleanup(func() { db.Close() })
    return db
}

Test Error Semantics

Advisory: Test error semantics, not error message strings.

go
// Bad: Brittle string comparison
if err.Error() != "invalid input" { ... }

// Good: Semantic check
if !errors.Is(err, ErrInvalidInput) { ... }

For simple presence checks when specific semantics don't matter:

go
if gotErr := err != nil; gotErr != tt.wantErr {
    t.Errorf("f(%v) error = %v, want error presence = %t", tt.input, err, tt.wantErr)
}

  • Error testing: See go-error-handling when testing error semantics with errors.Is/errors.As or sentinel errors
  • Interface mocking: See go-interfaces when creating test doubles by implementing interfaces at the consumer side
  • Naming test functions: See go-naming when naming test functions, subtests, or test helper utilities
  • Linter integration: See go-linting when running linters alongside tests in CI or pre-commit hooks

© cxuu, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 7 other files (scripts, references, assets) in skills/go-testing of cxuu/golang-skills.

  • SKILL.md
  • assets/table-test-template.go
  • references/INTEGRATION.md
  • references/TABLE-DRIVEN-TESTS.md
  • references/TEST-HELPERS.md
  • references/TEST-ORGANIZATION.md
  • references/VALIDATION-APIS.md
  • scripts/gen-table-test.sh

Open the folder on GitHubat commit 91f0c2e

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in cxuu/golang-skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Go Testing next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Go Testing compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Go Testing this skillcxuu/golang-skills1701 repos~1.3kAutomated safety check: PassApache-2.0
Mobile App Testingsecondsky/claude-skills227—~643Automated safety check: PassMIT
Test Automationrevfactory/harness-1001.3k—~1.7kAutomated safety check: PassApache-2.0
Web Testing with Playwright and Vitestwithkynam/vibecode-pro-max-kit1.1k—~892Automated safety check: PassApache-2.0
Test CommanderEliasOulkadi/shokunin114—~3kAutomated safety check: NotesMIT
API Test Suite Builderborghei/Claude-Skills874—~1.6kAutomated safety check: PassMIT

Similar skills

  • Mobile App Testing

    secondsky/claude-skills

    Mobile app testing with unit tests, UI automation, performance testing.

    227 GitHub stars~643 tokensUpdated 9 days ago
    Testing & QAAuto-check passed
  • Test Automation

    revfactory/harness-100

    A full test automation pipeline. An agent skill from revfactory/harness-100.

    1.3k GitHub stars~1.7k tokensUpdated 6 mo ago
    Testing & QAAuto-check passed
  • Web Testing with Playwright and Vitest

    withkynam/vibecode-pro-max-kit

    Covers web testing from unit to E2E, load, visual, accessibility and security checks, with Playwright, Vitest and k6 guides plus a Playwright setup script.

    1.1k GitHub stars~892 tokensUpdated 3 mo ago
    Testing & QAAuto-check passed
  • Test Commander

    EliasOulkadi/shokunin

    Generate unit, integration, E2E, and visual regression tests following the Testing Trophy methodology (80% integration).

    114 GitHub stars~3k tokensUpdated 2 days ago
    Testing & QAAuto-check: notes
  • API Test Suite Builder

    borghei/Claude-Skills

    Generate API test suites from route definitions across frameworks: auth, input validation, contract, k6 load testing, mocking, and OpenAPI-driven generation.

    874 GitHub stars~1.6k tokensUpdated today
    Testing & QAAuto-check passed
  • Nuxt Production

    secondsky/claude-skills

    | Nuxt 4 production optimization: hydration, performance, testing with Vitest, deployment to Cloudflare/Vercel/Netlify, and v4 migration.

    227 GitHub stars~3.3k tokensUpdated 9 days ago
    Testing & QAAuto-check: notes

More from cxuu/golang-skills

All 20 skills in this repo
  • Go Code Review

    cxuu/golang-skills

    A skill your agent uses when reviewing Go code or checking code against community style standards.

    170 GitHub stars~2.7k tokensUpdated 3 mo ago
    Auto-check passed
  • Go Performance

    cxuu/golang-skills

    A skill your agent uses when optimizing Go code, investigating slow performance, or writing performance-critical sections.

    170 GitHub starsUsed in 1 repo~1.3k tokens
    Auto-check passed
  • Go Documentation

    cxuu/golang-skills

    A skill your agent uses when writing or reviewing documentation for Go packages, types, functions, or methods.

    170 GitHub stars~1.3k tokensUpdated 3 mo ago
    Auto-check passed
  • Go Error Handling

    cxuu/golang-skills

    A skill your agent uses when writing Go code that returns, wraps, or handles errors — choosing between sentinel errors, custom types, and fmt.Errorf (%w vs %v), structuring error flow, or deciding…

    170 GitHub stars~1.5k tokensUpdated 3 mo ago
    Auto-check passed
  • Go Interfaces

    cxuu/golang-skills

    A skill your agent uses when defining or implementing Go interfaces, designing abstractions, creating mockable boundaries for testing, or composing types through embedding.

    170 GitHub stars~1.4k tokensUpdated 3 mo ago
    Auto-check passed
  • Go Naming

    cxuu/golang-skills

    A skill your agent uses when naming any Go identifier — packages, types, functions, methods, variables, constants, or receivers — to ensure idiomatic, clear names.

    170 GitHub stars~1.7k tokensUpdated 3 mo ago
    Auto-check passed

Categories

Questions about Go Testing

What does Go Testing do?

A skill your agent uses when writing, reviewing, or improving Go test code — including table-driven tests, subtests, parallel tests, test helpers, test doubles, and assertions with cmp.Diff. Go Testing is an agent skill from cxuu/golang-skills.Diff.

When should I use Go Testing?

Go Testing fits situations like: improving Go test code — including table-driven tests; assertions with cmp.Diff; A user asks to write a test for a Go function; even if they dont mention specific patterns like table-driven tests.

How do I install Go Testing in Claude Code?

Run `npx skills add cxuu/golang-skills --skill go-testing -a claude-code`. Or copy the skill folder (skills/go-testing in cxuu/golang-skills) into .claude/skills/go-testing in your project. Claude Code loads it when a task matches its description.

How do I install Go Testing in Codex?

Run `npx skills add cxuu/golang-skills --skill go-testing -a codex`. Or copy the skill folder (skills/go-testing in cxuu/golang-skills) into .agents/skills/go-testing in your project. Codex loads it when a task matches its description.

Can I use Go Testing in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add cxuu/golang-skills --skill go-testing -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/go-testing, .gemini/skills/go-testing, .github/skills/go-testing and .opencode/skills/go-testing in your project.

What does Go Testing need to run?

Going by SKILL.md and its folder, Go Testing needs Go and a shell for the scripts in its folder and the command-line tools its instructions call (go). Our summary lists: A Bash shell. Its frontmatter pre-approves these tools: Bash(bash:*).

Does Go Testing access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Go Testing safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Go Testing use?

Go Testing is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Go Testing use?

About 1.3k tokens (SKILL.md is roughly 5.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 5k tokens, read only when the agent opens those files.

What are the alternatives to Go Testing?

Skills that share tags, products or a category with Go Testing: Mobile App Testing (secondsky/claude-skills, 227 stars), Test Automation (revfactory/harness-100, 1.3k stars), Web Testing with Playwright and Vitest (withkynam/vibecode-pro-max-kit, 1.1k stars) and Test Commander (EliasOulkadi/shokunin, 114 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Go Testing?

cxuu (a GitHub user) maintains it in cxuu/golang-skills, which has 170 GitHub stars. The repository holds 20 skills in this directory. The repository was last updated on June 20, 2026.

Source: cxuu/golang-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.