standards-go-testing

Codify idiomatic Go testing patterns for unit, benchmark, and fuzz tests.

2|Updated Apr 10, 2024
One-click install
npx skills add https://github.com/gdurandvadas/dotfiles --skill standards-go-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: standards-go-testing
Source: https://github.com/gdurandvadas/dotfiles/tree/main/config/opencode/skills/standards-go-testing
Command: npx skills add https://github.com/gdurandvadas/dotfiles --skill standards-go-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Establish and enforce idiomatic Go testing practices across projects to improve reliability, readability, and maintainability of tests, benchmarks, and fuzz targets.

Core Features & Use Cases

  • Table-driven tests, subtests, testdata, fakes, benchmarks, and fuzz targets as standard patterns.
  • Guidance for Go test reviews, deterministic time handling, golden files, and test doubles to stabilize test outcomes.
  • Use Case: new contributors can onboard quickly by applying a unified testing standard across codebases.

Quick Start

Run go test ./... to execute all tests across the repository.

Frequently Asked Questions about standards-go-testing

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

FAQPage Schema
What are the standard patterns for Go testing across projects?

Idiomatic Go testing patterns include table-driven tests, subtests, testdata, fakes, benchmarks, and fuzz targets. Applying these guidelines ensures consistent code reviews and faster onboarding across projects.

How do I enforce consistent Go test reviews for table-driven tests and fuzzing?

Enforce consistent Go test reviews by codifying standard patterns like table-driven tests, testdata, and fuzz targets. Validating these patterns through standard go test workflows ensures consistent reviews and faster onboarding for new contributors.

Does this Go testing standard support deterministic time handling and golden files?

Yes, the Go testing standard supports deterministic time handling and golden files alongside test doubles. These mechanisms stabilize test outcomes and ensure reliable execution across different testing environments.

Can I use standard go test workflows to execute benchmarks and fuzz tests?

Yes, you can execute benchmarks and fuzz tests using standard go test workflows. Running go test ./... applies the required patterns across the repository, validating unit tests, benchmarks, and fuzz targets.

What's the best way to structure Go test data and fakes for new contributors?

The best way to structure Go test data and fakes is by using the testdata directory and standard test doubles. This unified testing standard allows new contributors to onboard quickly by applying consistent patterns across codebases.