golang-testing

golang-testing is a skill for Claude Code from shennawardana23/skillme. It costs 92 tokens per session (1,631 once invoked), scanned A, original, Apache-2.0.

A guide to measuring Go code speed and testing it with unexpected inputs. Benchmarking measures performance and memory use, while fuzzing repeatedly tries varied inputs to find failures.

In plain words
What is it for?
It helps compare Go implementations, measure allocations, write performance benchmarks, and add fuzz tests for parsers or validators.
Why use it?
Ordinary tests may show that known cases work but not whether a change became slower or breaks on an input you did not anticipate.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the skillme plugin — 137 skills, 2 commands shipped together

Good fit It helps compare Go implementations, measure allocations, write performance benchmarks, and add fuzz tests for parsers or validators.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/shennawardana23/skillme/golang-testing
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 shennawardana23/skillme --skill golang-testing
Clone the repo
git clone --depth 1 https://github.com/shennawardana23/skillme

Made for: Claude Code.

Or install skillme, the plugin that ships this one along with the rest of its 137 skills, 2 commands.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/shennawardana23/skillme/golang-testing/github.svg)](https://agentmods.dev/skills/shennawardana23/skillme/golang-testing)
Your own site
<a href="https://agentmods.dev/skills/shennawardana23/skillme/golang-testing"><img src="https://agentmods.dev/badge/skills/shennawardana23/skillme/golang-testing/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 golang-testing

Your own site · 80×15
<a href="https://agentmods.dev/skills/shennawardana23/skillme/golang-testing"><img src="https://agentmods.dev/badge/skills/shennawardana23/skillme/golang-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 92 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,631 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.00092 $0.01631
Opus 5 $0.00046 $0.00816
Sonnet 5 $0.00018 $0.00326
Haiku 4.5 $0.00009 $0.00163

Measured 9d ago against content hash 17188b9e089d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

golang-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 9d 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.

skills/golang-testing/SKILL.md · 169 lines

How it starts

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

Go Benchmark-Driven Optimization and Fuzzing

Table-driven unit tests answer "is this correct." This skill answers two different questions: "is this fast enough, and did my change actually help" (benchmarks), and "does this hold for inputs I didn't think to write a test case for" (fuzzing). Reach for go-service-idioms or test-driven-development for ordinary correctness tests first — only bring in benchmarks once a performance question is on the table, and fuzzing once a function parses or validates untrusted/varied input.

Writing a benchmark

func BenchmarkProcess(b *testing.B) {
    data := generateTestData(1000)
    b.ResetTimer() // exclude setup cost above from the measured loop
    for i := 0; i < b.N; i++ {
        Process(data)
    }
}

Run with -benchmem always — throughput (ns/op) without allocation counts (B/op, allocs/op) hides regressions where a change got faster per-op but started allocating more, which shows up as GC pressure under real load:

go test -bench=BenchmarkProcess -benchmem ./...
# BenchmarkProcess-8   10000   105234 ns/op   4096 B/op   10 allocs/op

Sub-benchmarks to compare alternatives directly

Use b.Run to benchmark several implementations side by side in one invocation, so the comparison runs under identical conditions:

func BenchmarkJoin(b *testing.B) {
    parts := []string{"hello", "world", "foo", "bar", "baz"}

    b.Run("plus_concat", func(b *testing.B) {
        for i := 0; i < b.N; i++ {
            var s string
            for _, p := range parts {
                s += p
            }
            _ = s
        }
    })

    b.Run("strings_builder", func(b *testing.B) {
        for i := 0; i < b.N; i++ {
            var sb strings.Builder
            for _, p := range parts {
                sb.WriteString(p)
            }
            _ = sb.String()
        }
    })
}

This is how a claim like "strings.Builder is faster than += in a loop" (see golang-patterns) gets verified rather than taken on faith — run both, read the numbers, don't guess.

Read the full file on GitHub · 169 lines

Files

What ships with it

1 file 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. 9d ago First seen · 169 lines · 92 tokens per session scan A 17188b9e089d

Subscribe to this mod's changes

golang-testing is a skill published in the GitHub repository shennawardana23/skillme (2 stars, last pushed 15d ago), licensed Apache-2.0. It adds 92 tokens to every session and 1,631 once invoked, about $0.0005 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-09-03.

Related

Other skills, from other repositories

encore-go-testing

Write or run automated tests for Encore Go code with encore test and the standard library testing package. Covers isolated per-test databases, calling handlers directly, and testing.T patterns.

encoredev/skills · 47 tokens

go-testing-mistakes

Guides the agent to avoid common Go testing mistakes when writing or reviewing test code. Covers test categorization (build tags, env vars, short mode), race detection, test execution modes (parallel, shuffle), table-driven tests, avoiding sleeps in tests, handling the time API deterministically, using httptest/iotest…

v0lka/skills · 126 tokens

go-testing

Use when writing or fixing Go tests — table-driven cases, parallel safety, helpers, fakes, fuzzing, deterministic time (testing/synctest), goroutine leak detection (goleak), HTTP handlers. Apply proactively when a function gets a new test or a test is flaky. Benchmark methodology: see go-benchmark.

muratmirgun/gophers · 70 tokens

golang-testing

Go testing patterns for unit tests, table-driven tests, subtests, test helpers, mocking/fakes, benchmarks, fuzzing, and coverage. Use when writing or reviewing Go tests to improve correctness, stability, and maintainability.

AeonDave/malskill · 50 tokens

cmd_go_test

Enforce TDD workflow for Go. Write table-driven tests first, then implement. Verify 80%+ coverage with go test -cover.

majiang213/OpenClaw-MAS · 33 tokens

golang-testing

Go testing with Ginkgo BDD suites, Gomega matchers, uber-go/mock mocks, and benchmarks. Use when writing unit tests, generating mocks for interfaces, setting up test suites, or running parallel tests in Go projects. Apply whenever user writes Describe/It/BeforeEach blocks, uses mockgen, or asks about Ginkgo setup.

shipengqi/skills · 73 tokens