# Go Testing

> Go testing patterns. Routes to specific patterns. Use when this capability is needed.

- Skill: `tomevault-io/go-testing-4` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/go-testing-4`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/go-testing-4/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/go-testing-4

---


# Testing

## Route by Pattern
- Table-driven tests → see [table/](table/)
- Subtests with t.Run → see [subtests/](subtests/)
- Test helpers → see [helpers/](helpers/)
- Benchmarks → see [benchmarks/](benchmarks/)

## Quick Check
- [ ] Tests named Test_Function_Scenario
- [ ] Table tests for >2 cases
- [ ] Helpers call t.Helper()
- [ ] Parallel tests capture loop vars

## Common Patterns

**Basic test structure:**
```go
func Test_Function_Scenario(t *testing.T) {
    // Arrange
    input := "test"

    // Act
    result := Function(input)

    // Assert
    if result != expected {
        t.Errorf("got %v, want %v", result, expected)
    }
}
```

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/jamesprial) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-13 -->

