SKILL

golang-testing

Go testing patterns including table-driven tests, subtests, benchmarks, fuzzing, and test coverage. Follows TDD methodology with idiomatic Go practices. Use when writing Go tests — table-driven cases, subtests, benchmarks, fuzzing, or coverage.

Target: Software development & testing. Automatically collected · unverified.

Excerpt from the author’s documentation

Extracted from a fixed version of SKILL.md in its original language. This is the author’s documentation; installation, compatibility and runtime results have not been verified by this site.

Read the original English text

Topics in the source

  • Go Testing Patterns
  • When to Activate
  • TDD Workflow for Go
  • The RED-GREEN-REFACTOR Cycle
  • Step-by-Step TDD in Go
  • Table-Driven Tests
  • Table-Driven Tests with Error Cases
  • Subtests and Sub-benchmarks

Comprehensive Go testing patterns for writing reliable, maintainable tests following TDD methodology. Writing new Go functions or methods Adding test coverage to existing code Creating benchmarks for performance-critical code Implementing fuzz tests for input validation Following TDD workflow in Go projects The standard pattern for Go tests. Enables comprehensive coverage with minimal code. Testing against expected output files stored in testdata/. | Code Type | Target | |-----------|--------| | Critical business logic | 100% | | Public APIs | 90%+ | | General code | 80%+ | | Generated code | Exclude | DO: Write tests FIRST (TDD) Use table-driven tests for comprehensive coverage Test behavior, not implementation Use t.Helper() in helper functions Use t.Parallel() for independent tests Clean up resources with t.Cleanup() Use meaningful test names that describe the scenario DON'T: Test private functions directly (test through public API) Use time.Sleep() in tests (use channels or conditions) Ignore flaky tests (fix or remove them) Mock everything (prefer integration tests when possible) Skip error path testing Remember: Tests are documentation. They show how your code is meant to be

This is an excerpt. Refer to the complete source and its current requirements.

Source repository
affaan-m/ECC
Source file
pi/core/skills/golang-testing/SKILL.md
Fixed revision
d2ef2680594f9a17526a6e1a2e18b3d242c5d17b
Read the complete original documentation ↗

Sources and evidence

This record was collected automatically. Its documentation, suitability and runtime behavior have not been manually verified.

Author: affaan-m/ECC · original repository metadata. Documentation review: Not reviewed. Last source check: 2026-11-09T15:01:43.032Z.

Categories are inferred from names, descriptions and paths. They do not establish compatibility.

License and attribution

MIT. Third-party content and copyright remain with their authors. Refer to the original license and terms.

Original license ↗

Synchronization, copying and user-reported success do not mark a resource as runtime-tested.

Limitations and notes

  • Collecting metadata does not mean this site has installed, adapted, runtime-tested or security-reviewed the resource.