golang-testing

Guide Go test suite design with table-driven subtests and goleak detection.

1|Updated May 27, 2026
One-click install
npx skills add https://github.com/dmwin72015/netdisk --skill golang-testing-dmwin72015
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-testing
Source: https://github.com/dmwin72015/netdisk/tree/main/.agents/skills/golang-testing
Command: npx skills add https://github.com/dmwin72015/netdisk --skill golang-testing-dmwin72015

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires go, gotests, and includes references (resource) components.

What problem does it solve?

This Skill helps Go teams avoid brittle, slow, and flaky test suites by providing production-ready testing patterns and tooling practices.

Core Features & Use Cases

  • Table-driven and idiomatic test design: Enforces named subtests, deterministic structure, and behavior-focused assertions.
  • Safe concurrency testing: Recommends parallelism where appropriate and adds goroutine leak detection via goleak.
  • Quality at scale: Covers integration test separation (build tags), fuzzing, fixtures, and coverage/benchmark guidance for ongoing reliability.

Quick Start

Use the golang-testing skill to generate or review a Go test suite for your package, ensuring table-driven coverage with named subtests, deterministic behavior, and goroutine leak detection.

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 Go tests with named subtests for deterministic behavior?

Go integration tests are separated using build tags to distinguish them from standard unit tests. This approach isolates slower, dependency-heavy integration logic while keeping your core test suite fast and deterministic during regular development.

How do I detect goroutine leaks in my Go concurrency tests?

Goroutine leak detection in Go tests is handled using goleak. You integrate goleak verification into your test suite to identify and prevent unreleased goroutines, ensuring safe concurrency testing and reliable production-grade test execution.

What is the best way to scaffold consistent Go test structures automatically?

Scaffolding consistent Go test structures is achieved safely using the gotests tool. Gotests generates idiomatic table-driven test boilerplate, guiding authors to design maintainable test suites and ensuring uniform test coverage across different Go packages.

Does this Go testing approach support fuzzing and executable documentation?

This Go testing approach supports fuzzing and example-based executable documentation. It guides authors to validate public behavior assertions, apply fuzzing for edge-case discovery, and generate executable examples that serve as reliable, production-grade documentation.