go-testing-with-testify

go-testing-with-testify is a skill for Claude Code, Codex from n-n-code/n-n-code-skills. It costs 75 tokens per session (4,848 once invoked), scanned A, original, MIT.

A guide for writing and reviewing Go tests with Testify, a toolkit that adds assertions, mocks, and test suites to Go’s standard testing package.

In plain words
What is it for?
Use it for Go unit, integration, or HTTP-handler tests; refactoring test files; choosing between mocks and hand-written fakes; and checking failures with race or repeat runs.
Why use it?
It helps make tests clearer and more reliable, including tests that use tables, subtests, parallel execution, wrapped errors, or mocks, and helps investigate flaky tests.

Skill for Claude CodeCodex

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/n-n-code/n-n-code-skills/go-testing-with-testify
Any agent
npx skills add n-n-code/n-n-code-skills --skill go-testing-with-testify
Clone the repo
git clone --depth 1 https://github.com/n-n-code/n-n-code-skills

Made for: Claude Code, Codex.

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-with-testify

README.md
[![agentmods](https://agentmods.dev/badge/skills/n-n-code/n-n-code-skills/go-testing-with-testify.svg)](https://agentmods.dev/skills/n-n-code/n-n-code-skills/go-testing-with-testify)
Your own site
<a href="https://agentmods.dev/skills/n-n-code/n-n-code-skills/go-testing-with-testify"><img src="https://agentmods.dev/badge/skills/n-n-code/n-n-code-skills/go-testing-with-testify.svg" alt="Measured on agentmods" height="20"></a>
Per session 75 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,848 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.00075 $0.04848
Opus 5 $0.00037 $0.02424
Sonnet 5 $0.00015 $0.00970
Haiku 4.5 $0.00007 $0.00485

Measured 4d ago against content hash 4fbe5a7251ab, 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-with-testify 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.

.agents/skills/go-testing-with-testify/SKILL.md · 383 lines

How it starts

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

Go Testing With Testify

Workflow for writing, reviewing, and hardening Go tests built on the standard testing package and the stretchr/testify toolkit (assert, require, mock, suite).

Go+testify tests are checks — automated pass/fail assertions on behavior contracts. Testing as investigation — charters, heuristics, oracles under stress, edge-case discovery, perspective rotation — is upstream. Compose with tester-mindset when strategy, risk framing, or the shape of the unknown dominates.

When To Use

  • writing new Go unit, integration, or HTTP handler tests with testify
  • refactoring existing *_test.go files: tightening assertions, extracting table-driven tests, introducing subtests, or adding t.Parallel()
  • reviewing PRs that add or change Go tests
  • triaging a flaky Go test (intermittent, -race complaints, order-dependent)
  • replacing reflect.DeepEqual / string-match / manual error checking with testify assertions, or deciding when not to
  • deciding between a hand-written fake and testify/mock, or between flat subtests and a suite.Suite
  • pairing with tester-mindset for claims, oracles, and edge-case coverage
  • pairing with backend-guidance or backend-systems-guidance for service- boundary test design in Go services

Not For

  • standing up a Go module or repo-level test tooling from scratch — that is a one-off install step (go mod init, go get github.com/stretchr/testify) not a skill-shaped workflow
  • strategy work without any testify or testing code in the loop — that is a tester-mindset job
  • pure code-style review of non-test Go code — this skill should not be primary; use the repo's implementation or review skill set instead, typically backend-guidance or backend-systems-guidance for Go services
  • Ginkgo, Gomega, go-cmp-only, or gocheck suites — the testify idioms below will fight those stacks

Routing Flowchart

digraph route {
    "Main artifact is testify-based Go test code or test review?" [shape=diamond];
    "Main artifact is strategy,\nedge-case discovery, or test planning\nwithout concrete test code?" [shape=diamond];
    "go-testing-with-testify" [shape=box];
    "tester-mindset" [shape=box];
    "coding-guidance-go or another repo skill set" [shape=box];

    "Main artifact is testify-based Go test code or test review?" -> "go-testing-with-testify" [label="yes"];
    "Main artifact is testify-based Go test code or test review?" -> "Main artifact is strategy,\nedge-case discovery, or test planning\nwithout concrete test code?" [label="no"];
    "Main artifact is strategy,\nedge-case discovery, or test planning\nwithout concrete test code?" -> "tester-mindset" [label="yes"];
    "Main artifact is strategy,\nedge-case discovery, or test planning\nwithout concrete test code?" -> "coding-guidance-go or another repo skill set" [label="no"];
}

Read the full file on GitHub · 383 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 383 lines · 75 tokens per session scan A 4fbe5a7251ab

Subscribe to this mod's changes

go-testing-with-testify is a skill published in the GitHub repository n-n-code/n-n-code-skills (4 stars, last pushed 6d ago), licensed MIT. It adds 75 tokens to every session and 4,848 once invoked, about $0.0004 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.

Related

Other skills, from other repositories

setup

Wire Ginkgo into a Go package — install the ginkgo CLI and Ginkgo+Gomega, ginkgo bootstrap to generate the suitetest.go (TestXxx/RegisterFailHandler(Fail)/RunSpecs), the package xxxtest convention, dot-import alternatives (aliased import, dsl/ subpackages, --nodot), ginkgo generate, and testing.T interop via…

onsi/ginkgo · 118 tokens

assertions

Write correct synchronous Gomega assertions — Expect/Ω notation, the To/NotTo/ToNot/Should/ShouldNot equivalences, the multi-return error idiom, Succeed vs HaveOccurred, the .Error() chaining form, annotating assertions (format-string and func()string), tuning failure output via the format subpackage…

onsi/gomega · 145 tokens

gstruct

Deep, partial matching of nested structs, slices, maps, and pointers with gstruct — MatchAllFields/MatchFields/Fields, MatchAllElements/MatchElements/Elements (idFn), MatchAllKeys/MatchKeys/Keys, PointTo, and the IgnoreExtras/IgnoreMissing/IgnoreUnexportedExtras/AllowDuplicates options, plus Ignore()/Reject(). Use…

onsi/gomega · 104 tokens

overview

The Ginkgo mental model for writing Go tests — the one idea that explains everything (Ginkgo builds a spec tree at construction time, then runs it) and its consequences for how you write specs, plus spec independence and the node taxonomy. Use this first when you start working with Ginkgo in a project, or to decide…

onsi/ginkgo · 84 tokens

go

Idiomatic Go - package and interface design, error wrapping, table-driven tests, generics, the modern standard library (slices/maps/cmp/errors.Join), current syntax, and logging discipline. Use when writing, reviewing, or refactoring any Go code, especially code drifting toward Java/Spring shapes (deep layer trees…

inference-gateway/inference-gateway · 99 tokens

test-with-gt

Write Go test code using the gt library. Use when writing tests, creating test files, or when the user asks to add tests for Go code.

gollem-dev/gollem · 35 tokens