Back to Skills

golang-testing

Provides a comprehensive guide for writing production-ready Golang tests. Covers table-driven tests, test suites with testify, mocks, unit tests, integration tests, benchmarks, code coverage, parallel tests, fuzzing, fixtures, goroutine leak detection with goleak, snapshot testing, memory leaks, CI with GitHub Actions, and idiomatic naming conventions. Use this whenever writing tests, asking about testing patterns or setting up CI for Go projects. Essential for ANY test-related conversation in G

1,714stars111forksUpdated 5/18/2026

Security Assessment

Medium Risk(50/100)

Detected risks:

Remote Code Execution([references/integration-testing.md] Exec()
Security Score50/100

About golang-testing

The golang-testing skill is designed to provide a comprehensive guide for writing robust, production-ready tests in Golang. It addresses the complexities and common pitfalls associated with testing Go applications, helping developers ensure their code is reliable, maintainable, and performant. By following established best practices, this skill assists engineers in structuring tests effectively, preventing fragile or order-dependent test cases, and avoiding unnecessary focus on implementation details. It provides guidance for both unit and integration tests, benchmarking, fuzzing, and memory leak detection, enabling developers to build confidence in their codebase and reduce runtime errors.

FAQ

How do I use golang-testing for my Go project?

You can invoke this skill whenever you need guidance on writing tests, reviewing existing test suites, debugging failing tests, or setting up CI pipelines for Go projects. It covers all test types, including unit, integration, benchmark, and fuzz tests, and guides you on structuring, naming, and running them effectively.

Is golang-testing compatible with all Go projects?

The skill is compatible with projects using the Go programming language and is designed to work with AI coding agents like Claude Code. It requires the Go toolchain and optional tools such as 'gotests' for scaffolding table-driven tests.

What are the limitations or prerequisites of using golang-testing?

You must have the Go environment installed, and for certain test scaffolding features, the 'gotests' tool needs to be installed. The skill assumes familiarity with Go syntax, testing frameworks like 'testify', and basic CI concepts. It does not generate tests outside of the Go ecosystem.

Can golang-testing help with CI/CD integration?

Yes, the skill provides guidance on running tests with race detection in CI pipelines, setting up GitHub Actions for automated testing, and ensuring tests are isolated and reliable in continuous integration environments.

Does golang-testing cover advanced testing topics like memory leaks or goroutine issues?

Yes, it covers goroutine leak detection using 'goleak', snapshot testing, memory leak detection, and guidance on writing tests that avoid flakiness and concurrency issues, ensuring more robust and maintainable test suites.

All Files

6 files
references/http-testing.md2.2 KB
View
references/helpers.md1.0 KB
View
references/integration-testing.md4.1 KB
View
evals/evals.json21.4 KB
View
references/mocking.md4.5 KB
View
SKILL.md12.8 KB
View

Install golang-testing

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill