golang-testing

Write production-ready Go tests with gotests, goleak, and testify.

Updated Mar 8, 2026
One-click install
npx skills add https://github.com/tamago0224/kuroshio-mta --skill golang-testing-tamago0224
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-testing
Source: https://github.com/tamago0224/kuroshio-mta/tree/main/.agents/skills/golang-testing
Command: npx skills add https://github.com/tamago0224/kuroshio-mta --skill golang-testing-tamago0224

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Writing reliable, production‑ready tests for Go applications is time‑consuming and error‑prone, often missing coverage of edge cases, concurrency issues, and CI integration.

Core Features & Use Cases

  • Provides a complete guide to table‑driven tests, testify usage, mock creation, and benchmark design.
  • Shows how to detect goroutine leaks with goleak, perform fuzz testing, and enforce best practices with linters.
  • Explains CI setup with GitHub Actions, including race detection and code coverage reporting. Use this skill when you need to ensure your Go code passes rigorous testing before deployment.

Quick Start

Ask the golang-testing skill to generate a table‑driven unit test for a function named CalculatePrice.

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 unit tests in Go?

You can generate table-driven Go unit tests using the gotests command and testify framework, which provide structured templates for defining test cases, assertions, and mock creation to ensure comprehensive code coverage.

What's the best way to detect goroutine leaks in Go applications?

Detect goroutine leaks in Go applications by integrating the goleak package into your test suite, verifying that no unexpected goroutines remain active after tests complete execution.

Can I use fuzz testing with my existing Go test setup?

Yes, fuzz testing can be integrated into your existing Go test setup, providing guidelines and templates to automatically generate random inputs and identify edge cases alongside standard unit and integration tests.

How do I configure GitHub Actions for Go CI with race detection?

Configure GitHub Actions CI for Go with race detection and code coverage reporting by following provided CI setup templates that enforce best practices and linters across your Go project testing pipeline.

Does this approach support both unit and integration testing for Go?

Yes, this approach supports both unit and integration testing for Go by providing a complete guide to table-driven tests, testify usage, mock creation, and benchmark design across diverse Go projects.

Why should I use testify over standard Go testing libraries?

Using testify simplifies Go test assertions and mock creation compared to standard libraries, offering expressive assertions that reduce boilerplate while maintaining rigorous testing standards for production-ready code.