# Go test table driven

> Go test table driven is an open-source agent skill for developer tools. Guides an agent to write, structure and refactor Go table-driven tests. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/eduardo-sl/go-agent-skills/tree/main/skills/(testing)/go-test-table-driven
- **Repository:** https://github.com/eduardo-sl/go-agent-skills
- **GitHub stars:** 90
- **License:** MIT
- **Skill name:** go-test-table-driven
- **Collection:** https://github.com/eduardo-sl/go-agent-skills
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-02

## About

This skill gives an agent a decision framework for when a Go test should be a table and when separate subtests are the better choice. It covers struct design rules such as keeping only fields that vary between cases, naming cases as short scenario sentences, and handling expected errors with a bool flag or a sentinel error checked via require.ErrorIs.

The guidance includes a checklist for reviewing existing tables, a symptom-to-fix table for bloated tables with many fields or per-case setup functions, and rules for keeping the loop body small. It also explains when t.Parallel is safe and how loop variable capture differs before and after Go 1.22.

It expects a Go project with the Go toolchain available. The skill's allowed tools include running go and gofmt, and it points to two reference files with fuller worked examples, loaded only when needed.

## When your agent uses it

> Deep dive on table-driven tests in Go: when to use them, when to avoid them, struct design, subtest naming, advanced patterns like test matrices and shared setup, and refactoring bloated tables into clean ones. Use when writing table-driven tests, refactoring test tables, reviewing table test structure, or deciding whether table-driven is the right approach. Trigger examples: "table-driven test", "table test", "test cases struct", "test matrix", "parametrize tests", "data-driven test", "refactor test table". Not for: general test strategy, mocks, golden files, fuzzing (go-test-quality), benchmarks (go-performance-review).

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/eduardo-sl/go-agent-skills/tree/HEAD/skills/(testing)/go-test-table-driven)
- [Asks for: Read, Edit, Write, Glob, Grep, Bash(go:*), Bash(gofmt:*)](https://github.com/eduardo-sl/go-agent-skills/blob/HEAD/skills/(testing)/go-test-table-driven/SKILL.md)
- [License: MIT](https://github.com/eduardo-sl/go-agent-skills/tree/HEAD/skills/(testing)/go-test-table-driven)

## Features

- **When tables fit:** Criteria for deciding whether a set of cases shares one function, assertion pattern and data-only differences.
- **Struct design rules:** Guidance on field selection, descriptive case names, and error expectations in table structs.
- **Refactoring bloated tables:** A symptom-to-fix guide for tables with too many fields, setup functions or branching logic.
- **Parallel subtests:** Notes on when t.Parallel is safe and how loop variable capture depends on the Go version.
- **Review checklist:** A short checklist covering case coverage, loop body size and subtest wrapping.

## Good for

- Convert a set of copy-pasted Go tests into a single table-driven test
- Decide whether a new test should be a table or separate subtests
- Refactor a test table that has grown setup functions and conditionals
- Review the structure of an existing Go table test
- Add happy path, error and edge cases to a parser or validator test

## Install

### Any agent

Download the skill folder from https://github.com/eduardo-sl/go-agent-skills and copy it into your agent's skills folder.

## FAQ

### What does the skill need to run?

It requires the Go toolchain and is designed for Claude Code or similar AI coding agents working on Go projects.

### When does Go test table driven trigger?

It triggers on requests about table-driven tests, table tests, test matrices, parametrized or data-driven tests, and refactoring test tables. Test strategy, mocks, golden files and fuzzing are handled by a separate skill.

### Does Go test table driven modify files?

Its allowed tools include Read, Edit, Write and Bash for go and gofmt, so it can edit test files and run the Go tools.

### What license is Go test table driven under?

The skill is released under the MIT license.

### Does Go test table driven run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Go test table driven?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Go test table driven?

The closest alternatives to Go test table driven are Go test quality, TDD, TDD workflow, Go backend and TDD.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Go test quality](https://ai-powered.com/skills/go-test-quality): Go test quality is an open-source agent skill for developer tools.
- [TDD](https://ai-powered.com/skills/tdd): TDD is an open-source agent skill for developer tools.
- [TDD workflow](https://ai-powered.com/skills/tdd-workflow-nabwinsaud): TDD workflow is an open-source agent skill for developer tools.
- [Go backend](https://ai-powered.com/skills/go-backend): Go backend is an open-source agent skill for developer tools.
- [TDD](https://ai-powered.com/skills/tdd-kripu77): TDD is an open-source agent skill for developer tools.
- [Go performance review](https://ai-powered.com/skills/go-performance-review): Go performance review is an open-source agent skill for developer tools.
- [Cpp testing](https://ai-powered.com/skills/cpp-testing): Cpp testing is an open-source agent skill for developer tools.
- [TDD loop](https://ai-powered.com/skills/tdd-loop): TDD loop is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/go-test-table-driven
