golang-testing

Standardize Go unit tests, benchmarks, and fuzzing workflows with table-driven tests and TDD patterns.

5|10|Updated Jan 8, 2026
One-click install
npx skills add https://github.com/chaitin/MonkeyCodeOfficialPlugins --skill golang-testing-chaitin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-testing
Source: https://github.com/chaitin/MonkeyCodeOfficialPlugins/tree/main/skills/golang-testing
Command: npx skills add https://github.com/chaitin/MonkeyCodeOfficialPlugins --skill golang-testing-chaitin

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Go projects often struggle to maintain consistent, reliable tests that cover edge cases, performance, and input validation. This Skill provides patterns and workflows to write table-driven tests, subtests, benchmarks, fuzzing, and TDD in idiomatic Go.

Core Features & Use Cases

  • Table-Driven Tests: concise coverage across multiple inputs.
  • Subtests and Parallel Tests: structured, scalable test suites.
  • Benchmarks and Performance Testing: measure and optimize speed.
  • Fuzzing (Go 1.18+): explore inputs and strengthen robustness.
  • TDD Workflow: red-green-refactor to guide development.

Quick Start

Run go test ./... to start applying table-driven tests, subtests, benchmarks, and fuzzing in your codebase.

Frequently Asked Questions about golang-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write table-driven tests in Go?

Table-driven tests in Go use a struct slice to define multiple test cases, iterating over them to run subtests. This standardizes unit test coverage across various inputs concisely within your Go packages.

What is the best way to run benchmarks for Go code?

Go benchmarks measure function execution speed using the standard go test tooling with the -bench flag. They provide performance testing metrics to identify bottlenecks and optimize code reliability across your project.

How do subtests and parallel tests work in Go?

Subtests use the t.Run function to create structured test hierarchies. Adding t.Parallel() inside subtests allows them to execute concurrently, providing scalable test suites for Go projects.

Does TDD workflow integrate with standard Go testing?

TDD workflows integrate with Go testing by following the red-green-refactor cycle. You write failing tests first, implement the minimum code to pass them, and then refactor for reliable idiomatic Go.