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.
npx skills add codeready-toolchain/tarsy --skill golang-testing-patternsgit clone --depth 1 https://github.com/codeready-toolchain/tarsyWrote 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.
[](https://agentmods.dev/skills/codeready-toolchain/tarsy/golang-testing-patterns)<a href="https://agentmods.dev/skills/codeready-toolchain/tarsy/golang-testing-patterns"><img src="https://agentmods.dev/badge/skills/codeready-toolchain/tarsy/golang-testing-patterns.svg" alt="Measured on agentmods" height="20"></a>- NVIDIA SkillSpector pass
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00047 | $0.01895 |
| Opus 5 | $0.00023 | $0.00948 |
| Sonnet 5 | $0.00009 | $0.00379 |
| Haiku 4.5 | $0.00005 | $0.00189 |
Grade A, and why
golang-testing-patterns 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 7d 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.
How it starts
The opening of the file, as written. The whole thing — 332 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Go Testing Patterns
Modern testing patterns for Go following 2025-2026 best practices.
Table-Driven Tests
The idiomatic Go approach for comprehensive testing.
Basic structure:
func TestFeature(t *testing.T) {
tests := []struct {
name string
input string
expected int
wantErr bool
}{
{
name: "valid input",
input: "hello",
expected: 5,
wantErr: false,
},
{
name: "empty input",
input: "",
expected: 0,
wantErr: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := ProcessString(tt.input)
if tt.wantErr {
if err == nil {
t.Errorf("expected error, got nil")
}
return
}
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
if got != tt.expected {
t.Errorf("got %d, want %d", got, tt.expected)
}
})
}
}
Using Subtests with t.Run()
Benefits:
- Clear failure messages showing which case failed
- Can run specific tests:
go test -run TestFeature/valid_input - Parallel execution support
Pattern:
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Parallel() // Run subtests in parallel
// ... test logic
})
}
Test Organization
File structure:
- Tests live alongside code:
service.go→service_test.go - Integration tests in separate package:
service_integration_test.go - Shared test utilities:
test/util/ortestutil/
Test function naming:
// Unit tests
func TestSessionService_CreateSession(t *testing.T) {}
func TestSessionService_CreateSession_ValidationError(t *testing.T) {}
// Integration tests
func TestSessionService_Integration(t *testing.T) {}
Setup and Teardown
Using t.Cleanup():
func TestWithCleanup(t *testing.T) {
// Setup
db := setupTestDB(t)
t.Cleanup(func() {
db.Close() // Always runs, even if test fails
})
// Test logic
// ...
}
Setup once for all subtests:
func TestSuite(t *testing.T) {
// Shared setup
db := setupTestDB(t)
t.Cleanup(func() { db.Close() })
t.Run("test1", func(t *testing.T) {
// Uses shared db
})
t.Run("test2", func(t *testing.T) {
// Uses shared db
})
}
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.
- 7d ago First seen · 332 lines · 47 tokens per session scan A 9eac58b03b0a
golang-testing-patterns is a skill published in the GitHub repository codeready-toolchain/tarsy (10 stars, last pushed 3d ago), licensed Apache-2.0. It adds 47 tokens to every session and 1,895 once invoked, about $0.0002 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.
Other skills, from other repositories
temporal-python-testing
Test Temporal workflows with pytest, time-skipping, and mocking strategies. Covers unit testing, integration testing, replay testing, and local development setup. Use when implementing Temporal workflow tests or debugging test failures.
python-testing
Guidelines for writing and running tests in the Agent Framework Python codebase. Use this when creating, modifying, or running tests.
unit-test
A Go testing workflow for writing unit tests: small tests that check individual functions or components. It supports table-driven cases, where many inputs and expected results are organised in one test, and subtests.
fuzzing-test
A Go testing guide for generating fuzz tests, which repeatedly try varied inputs to find crashes and unexpected behavior. It first checks whether the code is suitable for fuzzing.
test-go
Write, review, and improve Go test code for this project. Use whenever generating, reviewing, or modifying Go tests - including when invoked by the Tester agent, the /test prompt, or any test-related request. Covers table-driven tests, subtests, t.Parallel(), test helpers with t.Helper(), error assertions via…
go-testing-with-testify
Write, review, or harden Go tests using stretchr/testify assert, require, mock, or suite. Use for assertion choice, test doubles, subtests, concurrency, and flake triage in an existing Go test setup. Use coding-guidance-go for production code or non-testify tests and tester-mindset for test strategy without concrete…