golang-testing

Write production-grade Go tests with table-driven patterns and testify.

1|Updated Apr 4, 2026
One-click install
npx skills add https://github.com/Jylhis/claude-marketplace --skill golang-testing-jylhis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-testing
Source: https://github.com/Jylhis/claude-marketplace/tree/main/plugins/golang-dev/skills/golang-testing
Command: npx skills add https://github.com/Jylhis/claude-marketplace --skill golang-testing-jylhis

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing robust Go tests that are fast, maintainable, and CI-friendly can be challenging. This skill provides practical patterns for table-driven tests, test suites with testify, mocks, integration tests, benchmarks, and goroutine-leak detection to raise the quality bar in Go projects.

Core Features & Use Cases

  • Table-driven tests with named subtests for clear test case reporting and parallelism where appropriate.
  • Test suites and mocks using testify and mock patterns to isolate behavior behind interfaces.
  • Integration and benchmark guidance, code coverage, and CI workflow tips for Go codebases.
  • Goroutine leak detection with goleak to ensure clean shutdowns and reliable test results.

Quick Start

Run go test ./... using the recommended patterns and utilities to validate production-grade Go tests.

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 with named subtests for parallel execution?

Table-driven tests in Go use named subtests to define test cases structurally, enabling clear reporting and selective execution. This pattern supports parallelism where appropriate, ensuring deterministic results and fast feedback loops across Go toolchains.

How do I detect goroutine leaks in my Go tests using goleak?

Goroutine leak detection in Go tests uses goleak to verify clean shutdowns and reliable results. By integrating goleak verification, you ensure goroutines do not linger unexpectedly after test completion, maintaining process stability and deterministic test outcomes.

What is the best way to structure Go test suites and mocks using testify?

Go test suites and mocks using testify isolate behavior behind interfaces to ensure observable-behavior testing. This approach provides safe mocking patterns, structured test organization, and clear isolation for unit testing scenarios in Go projects.

How do I set up Go integration tests using build tags and fixtures?

Go integration tests use build tags to separate integration scenarios from unit tests, ensuring proper test organization. Combined with fixtures and fuzzing, this setup maintains fast feedback loops and deterministic results across the Go toolchain.

Can I use Go benchmarks and code coverage guidance for CI workflow integration?

Go benchmarks and code coverage guidance integrate directly into CI workflows to validate performance and quality checks. This setup enforces observable-behavior testing and provides measurable feedback on code efficiency and test thoroughness.

Why does my Go test suite produce non-deterministic results and flaky tests?

Non-deterministic Go test results often stem from improper parallel test execution or lingering goroutines. Enforcing named subtests, goleak for goroutine leak detection, and observable-behavior testing patterns ensures fast, maintainable, and deterministic test outcomes.