go-testing

Guide Go developers in writing tests per Google and Uber style guides.

Updated Feb 28, 2026
One-click install
npx skills add https://github.com/rondevz/phant --skill go-testing-rondevz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-testing
Source: https://github.com/rondevz/phant/tree/main/.agents/skills/go-testing
Command: npx skills add https://github.com/rondevz/phant --skill go-testing-rondevz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Go testing guidelines help engineers write clear, diagnosable tests and avoid common pitfalls.

Core Features & Use Cases

  • Test naming and organization: best practices for naming tests and organizing test files.
  • Table-driven tests and subtests: patterns to cover multiple inputs cleanly, with parallel execution where appropriate.
  • Test helpers and doubles: constructing reusable helpers, fakes, and mocks for reliable tests.
  • Assertion guidance and error messages: guidance to write meaningful failures without external assertion libraries.

Quick Start

Start by applying Google's and Uber's Go testing style guidelines to create maintainable, reliable test suites.

Frequently Asked Questions about go-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 subtests and parallel execution?

Table-driven tests in Go use a struct slice of test cases iterated with t.Run for subtests, calling t.Parallel to enable concurrent execution and ensure scalable, diagnosable test coverage across multiple inputs cleanly.

What are the best practices for naming and organizing Go tests?

Go test naming best practices involve using descriptive function names like TestFunctionName_Scenario, organizing test files alongside source code, and structuring subtests logically to produce meaningful failures and maintainable test suites.

Do I need an external assertion library to write meaningful Go test failures?

You do not need an external assertion library to write meaningful Go test failures, because standard Go testing facilities like t.Helper, t.Errorf, and t.Fatalf provide sufficient structure to generate clear, diagnosable error messages natively.

How do I create test helpers and test doubles like fakes and mocks in Go?

Creating test helpers and test doubles in Go involves building reusable functions with t.Helper to mark non-test routines, and constructing fakes or mocks to simulate dependencies, ensuring reliable and isolated unit tests.

What Go testing style guidelines does this approach follow for unit tests?

This approach follows Google's and Uber's Go testing style guidelines for unit tests, enforcing clear structure, standard testing facilities, meaningful error messages, and scalable patterns like table-driven tests without external assertion libraries.

When should I use parallel tests and subtests in my Go project?

You should use parallel tests and subtests in Go when running table-driven test cases that are independent, calling t.Parallel within t.Run to execute multiple cases concurrently and reduce overall test suite execution time safely.