AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified Apache-2.0 Self-run

Testing Go

skill-qte77-claude-code-plugins-testing-go · by qte77

Writes tests following TDD (using go test, testify, and rapid) best practices. Use when writing unit tests, integration tests, or table-driven tests in Go.

No reviews yet
0 installs
42 views
0.0% view→install

Install

$ agentstack add skill-qte77-claude-code-plugins-testing-go

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-qte77-claude-code-plugins-testing-go)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
2mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Testing Go? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

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: "user@example.com", 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.

Naming Convention

Format: Test{Type}_{Method}_{Behavior}

TestUserService_Create_ReturnsIDOnSuccess
TestValidateEmail_MissingAt
TestCalculateTotal_EmptyItems

Execution

go test ./...                           # All tests
go test -run TestUserService ./...      # Filter by name
go test -race ./...                     # Race detector
go test -v -run TestValidateAge ./...   # Verbose single test

Quality Gates

  • [ ] All tests pass (go test ./...)
  • [ ] TDD Red-Green-Refactor followed
  • [ ] Arrange-Act-Assert structure used
  • [ ] Table-driven tests for multiple cases
  • [ ] Behavior-focused (not implementation)
  • [ ] No stdlib behavior tested
  • [ ] Interface fakes use var _ Interface = (*fake)(nil) compile check

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.