testing-go

testing-go is a skill for Claude Code from qte77/claude-code-plugins. It costs 37 tokens per session (869 once invoked), scanned A, original, Apache-2.0.

A guide for writing tests in Go using test-driven development, or TDD: write a failing test, make it pass with the smallest change, then clean up the code. It covers Go’s test tools and common test structures.

In plain words
What is it for?
Use it to write Go unit, integration, table-driven, invariant, and behavior-focused tests with tools such as go test, testify, rapid, and gomock.
Why use it?
It gives tests a repeatable process and focuses them on observable behavior. It also helps choose between ordinary cases, edge cases, and tests using generated inputs.

Skill for Claude Code

Written for Claude Code: $ARGUMENTS substitution. Also seen: mentions Claude Code.

Part of the go-dev plugin — 3 skills shipped together

Good fit Use it to write Go unit, integration, table-driven, invariant, and behavior-focused tests with tools such as go test, testify, rapid, and gomock.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/qte77/claude-code-plugins/testing-go
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.

Any agent
npx skills add qte77/claude-code-plugins --skill testing-go
Clone the repo
git clone --depth 1 https://github.com/qte77/claude-code-plugins

Made for: Claude Code.

Or install go-dev, the plugin that ships this one along with the rest of its 3 skills.

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 testing-go

README.md
[![agentmods](https://agentmods.dev/badge/skills/qte77/claude-code-plugins/testing-go/github.svg)](https://agentmods.dev/skills/qte77/claude-code-plugins/testing-go)
Your own site
<a href="https://agentmods.dev/skills/qte77/claude-code-plugins/testing-go"><img src="https://agentmods.dev/badge/skills/qte77/claude-code-plugins/testing-go/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for testing-go

Your own site · 80×15
<a href="https://agentmods.dev/skills/qte77/claude-code-plugins/testing-go"><img src="https://agentmods.dev/badge/skills/qte77/claude-code-plugins/testing-go.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 869 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00037 $0.00869
Opus 5.5 $0.00015 $0.00348
Sonnet 5.5 $0.00007 $0.00174
Haiku 4.5 $0.00004 $0.00087

Measured 21d ago against content hash b3fd954b18f3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

testing-go 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 21d 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.

plugins/go-dev/skills/testing-go/SKILL.md · 117 lines

How it starts

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

Go Testing

Target: $ARGUMENTS

Writes focused, behavior-driven tests following project testing strategy.

Quick Reference

TDD methodology (language-agnostic): See tdd-core plugin (testing-tdd skill)

Go-specific documentation: references/

  • references/testing-strategy.md — Go tools (go test, testify, rapid, gomock)
  • references/tdd-best-practices.md — Go TDD examples (extends tdd-core)

Quick Decision

go test (default): Use table-driven tests for known cases. Works at unit/integration levels.

rapid (edge cases): Use for invariants that must hold for ALL inputs.

See references/testing-strategy.md for full methodology comparison.

TDD Essentials (Quick Reference)

Cycle: RED (failing test / compile error) -> GREEN (minimal pass) -> REFACTOR (clean up)

Structure: Arrange-Act-Assert (AAA)

func TestOrderCalculator_Total_SumsItemPrices(t *testing.T) {
    // ARRANGE
    calc := NewOrderCalculator()
    items := []Item{{Price: 10.00, Qty: 2}, {Price: 5.00, Qty: 1}}

    // ACT
    total := calc.Total(items)

    // ASSERT
    assert.Equal(t, 25.00, total)
}

Table-Driven Tests (Go Idiom)

func TestValidateEmail(t *testing.T) {
    tests := []struct {
        name    string
        email   string
        wantErr bool
    }{
        {name: "valid", email: "[email protected]", wantErr: false},
        {name: "missing @", email: "userexample.com", wantErr: true},
        {name: "empty", email: "", wantErr: true},
    }
    for _, tt := range tests {
        t.Run(tt.name, func(t *testing.T) {
            err := ValidateEmail(tt.email)
            if tt.wantErr {
                require.Error(t, err)
            } else {
                require.NoError(t, err)
            }
        })
    }
}

What to Test (KISS/DRY/YAGNI)

High-Value: Business logic, error paths, integration points, contracts

Avoid: Stdlib behavior, trivial getters, default zero values, type existence

See references/testing-strategy.md -> "Patterns to Remove" for full list.

Read the full file on GitHub · 117 lines

Files

What ships with it

2 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. 21d ago Changed · +1 lines b3fd954b18f3
  2. 1mo ago First seen · 116 lines · 37 tokens per session scan A 9ef33d8462e6

Subscribe to this mod's changes

testing-go is a skill published in the GitHub repository qte77/claude-code-plugins (3 stars, last pushed 4d ago), licensed Apache-2.0. It adds 37 tokens to every session and 869 once invoked, about $0.0001 per session on Opus 5.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