go-testing

go-testing is a skill for Claude Code, Codex from muratmirgun/gophers. It costs 70 tokens per session (2,524 once invoked), scanned A, original, MIT.

A set of guidelines for testing Go programs, including independent test cases, table-driven tests, parallel tests, fakes, fuzzing, HTTP handlers, and detecting leaked goroutines. Tests are treated as executable descriptions of expected behavior.

In plain words
What is it for?
Use it when writing or repairing Go tests, investigating flaky tests, testing concurrent code or HTTP handlers, adding fuzz tests, or checking for goroutine leaks.
Why use it?
It helps tests fail clearly and consistently instead of becoming flaky, depending on execution order, or breaking whenever internal implementation changes.

Skill for Claude CodeCodex

Part of the gophers plugin — 26 skills, 4 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/muratmirgun/gophers/go-testing
Any agent
npx skills add muratmirgun/gophers --skill go-testing
Clone the repo
git clone --depth 1 https://github.com/muratmirgun/gophers

Made for: Claude Code, Codex.

Or install gophers, the plugin that ships this one along with the rest of its 26 skills, 4 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for go-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/muratmirgun/gophers/go-testing.svg)](https://agentmods.dev/skills/muratmirgun/gophers/go-testing)
Your own site
<a href="https://agentmods.dev/skills/muratmirgun/gophers/go-testing"><img src="https://agentmods.dev/badge/skills/muratmirgun/gophers/go-testing.svg" alt="Measured on agentmods" height="20"></a>
Per session 70 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,524 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00070 $0.02524
Opus 5 $0.00035 $0.01262
Sonnet 5 $0.00014 $0.00505
Haiku 4.5 $0.00007 $0.00252

Measured 4d ago against content hash d9fcac807f26, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

go-testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude-plugin/skills/go-testing/SKILL.md · 200 lines

How it starts

The opening of the file, as written. The whole thing — 200 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Go Testing

Tests are executable specifications. Their job is to fail usefully when behaviour regresses — and to keep failing in the same way until the bug is fixed. Tests that are passing-or-flaky teach the team to ignore them, which is worse than no test at all.

Core Rules

  1. Failures must be diagnosable from the log alone. Every t.Errorf includes the function under test, the inputs, what we got, and what we wanted, in that order.
  2. No assertion libraries by default. Use the standard t.Errorf / t.Fatalf plus go-cmp for structural comparison. testify is acceptable when adopted consistently — pick one and stick with it.
  3. Test observable behaviour, not implementation details. If a refactor that preserves behaviour breaks the test, the test was wrong.
  4. Each test runs independently. No execution-order dependencies, no shared global state without t.Cleanup.
  5. t.Parallel() whenever the test is safe to run in parallel. Most are.
  6. t.Helper() is the first line of any helper function that calls t.Errorf/t.Fatalf. Reserve t.Fatal for "next line is meaningless without this value"; everything else uses t.Error. Never call t.Fatal/t.FailNow from a non-test goroutine — send the failure back via channel.

"Useful Failures" Format

The failure message is the test's user interface. The canonical shape:

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

// Bad — no function, no inputs, reversed
t.Errorf("expected %d but got %d", 5, got)

Always print got before want. With cmp.Diff(want, got), the diff shows (-want +got) — echo that direction in your message.

"No Asserts" Philosophy

Standard-library testing with if + t.Errorf reads as plain Go and produces messages you control. Assertion libraries shorten call sites but trade away message quality and reorder the got/want convention.

  • Defaultif got != want { t.Errorf("...") } plus cmp.Diff for structs, slices, maps, protos.
  • Permittedtestify if the team agrees and testifylint is enabled. require only when continuing is meaningless.
  • Avoid — mixing styles within the same package.

Read the full file on GitHub · 200 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 200 lines · 70 tokens per session scan A d9fcac807f26

Subscribe to this mod's changes

go-testing is a skill published in the GitHub repository muratmirgun/gophers (8 stars, last pushed 23d ago), licensed MIT. It adds 70 tokens to every session and 2,524 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.