golang-development:test

A command that creates tests for Go programs, including tests for individual functions, data-driven test cases, performance tests, and integration tests.

In plain words
What is it for?
Use it to generate unit tests, table-driven tests, benchmarks, integration tests, or all of them for Go code.
Why use it?
Writing all these test variations by hand takes time and can leave important cases uncovered. The command provides several test types from a file or function you specify.

Command

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 commands/geoffjay/claude-plugins/test
Clone the repo
git clone --depth 1 https://github.com/geoffjay/claude-plugins
Per session 23 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,176 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.00023 $0.03176
Opus 5 $0.00012 $0.01588
Sonnet 5 $0.00005 $0.00635
Haiku 4.5 $0.00002 $0.00318

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

Security

Grade A, and why

golang-development:test 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 2d 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/golang-development/commands/test.md · 578 lines

How it starts

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

Golang Development Test Command

Generate comprehensive, production-ready tests for Go code including unit tests, table-driven tests, benchmarks, and examples.

Usage

/golang-development:test <file-or-function> [test-type] [options]

Arguments

  • $1 - File path or function name to test (required)
  • $2 - Test type: unit, table, benchmark, integration, all (optional, defaults to unit)
  • $3 - Options as JSON (optional)

Examples

# Generate unit tests for a file
/golang-development:test internal/service/user.go

# Generate table-driven tests
/golang-development:test internal/service/user.go table

# Generate benchmarks
/golang-development:test internal/service/user.go benchmark

# Generate all test types
/golang-development:test internal/service/user.go all

# Generate tests with options
/golang-development:test internal/service/user.go unit '{"with_mocks": true, "coverage_target": 90}'

Test Types

1. Unit Tests

Basic unit tests for individual functions:

// Source: user.go
package service

type User struct {
    ID    string
    Email string
    Age   int
}

func (u *User) IsAdult() bool {
    return u.Age >= 18
}

func ValidateEmail(email string) error {
    if !strings.Contains(email, "@") {
        return errors.New("invalid email format")
    }
    return nil
}

// Generated: user_test.go
package service

import (
    "testing"
)

func TestUser_IsAdult(t *testing.T) {
    t.Run("adult user", func(t *testing.T) {
        user := &User{Age: 25}
        if !user.IsAdult() {
            t.Error("expected user to be adult")
        }
    })

    t.Run("minor user", func(t *testing.T) {
        user := &User{Age: 15}
        if user.IsAdult() {
            t.Error("expected user to be minor")
        }
    })

    t.Run("edge case - exactly 18", func(t *testing.T) {
        user := &User{Age: 18}
        if !user.IsAdult() {
            t.Error("18 year old should be adult")
        }
    })
}

func TestValidateEmail(t *testing.T) {
    tests := []struct {
        name    string
        email   string
        wantErr bool
    }{
        {
            name:    "valid email",
            email:   "[email protected]",
            wantErr: false,
        },
        {
            name:    "invalid email - no @",
            email:   "userexample.com",
            wantErr: true,
        },
        {
            name:    "empty email",
            email:   "",
            wantErr: true,
        },
    }

    for _, tt := range tests {
        t.Run(tt.name, func(t *testing.T) {
            err := ValidateEmail(tt.email)
            if (err != nil) != tt.wantErr {
                t.Errorf("ValidateEmail() error = %v, wantErr %v", err, tt.wantErr)
            }
        })
    }
}

Read the full file on GitHub · 578 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. 2d ago First seen · 578 lines · 23 tokens per session scan A eb114e91d75a

Subscribe to this mod's changes

golang-development:test is a command published in the GitHub repository geoffjay/claude-plugins (8 stars, last pushed 10mo ago), licensed MIT. It adds 23 tokens to every session and 3,176 once invoked, about $0.0001 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.