go-testing

Codify Go test patterns from Google and Uber style guides.

2|1|Updated Mar 12, 2026
One-click install
npx skills add https://github.com/zajca/zfaktury --skill go-testing-zajca
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-testing
Source: https://github.com/zajca/zfaktury/tree/main/.agents/skills/go-testing
Command: npx skills add https://github.com/zajca/zfaktury --skill go-testing-zajca

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance on writing effective, maintainable, and robust Go tests, addressing common pitfalls and promoting best practices.

Core Features & Use Cases

  • Test Structure: Learn patterns for naming, table-driven tests, and subtests.
  • Assertion Strategies: Understand when to use standard comparisons vs. assertion libraries.
  • Test Helpers & Doubles: Implement reusable helpers and appropriate test doubles (stubs, mocks).
  • Use Case: When writing new Go test code or reviewing existing test suites, use this Skill to ensure adherence to Google's testing style guide and improve test quality.

Quick Start

Consult the go-testing skill for guidance on structuring Go tests using table-driven approaches.

Frequently Asked Questions about go-testing

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

FAQPage Schema
How do I structure Go unit tests using table-driven tests?

Table-driven tests in Go structure test cases as data slices, iterating through them to execute subtests. This pattern promotes maintainable test suites by separating test logic from test data, ensuring diagnosable coverage.

What are the best practices for naming Go test functions?

Go test naming conventions recommend descriptive function names indicating the target function and specific scenario. Following Google and Uber style guides ensures test suites remain maintainable and easily diagnosable.

Should I use assertion libraries or standard comparisons in Go testing?

Go testing assertion strategies involve choosing between standard library comparisons and assertion libraries. Standard comparisons keep dependencies minimal, while assertion libraries improve readability for complex test helper implementation.

How do I implement test helpers and test doubles in Go?

Test helpers and test doubles in Go require implementing reusable functions for stubs and mocks. Proper test double strategies isolate dependencies, allowing developers to write robust and maintainable test suites.

How do I run Go subtests in parallel for faster test execution?

Parallel execution in Go subtests uses the t.Parallel() method within table-driven tests. This technique prevents blocking, improving execution speed while maintaining test diagnosability and adhering to best practices.

When should I use subtests instead of individual test functions in Go?

Subtests in Go are best used when grouping related test scenarios, often within table-driven tests. They provide granular control over parallel execution and helper contexts, improving maintainability over isolated test functions.