go-testing-advanced
Installation
SKILL.md
Go Testing — Advanced Patterns
This skill extends go-testing with mocking, benchmarks, fuzzing, HTTP testing, and CI/CD.
When to Activate
- Writing interface-based mocks without external libraries
- Benchmarking performance-critical code
- Using Go 1.18+ fuzzing for input validation
- Testing HTTP handlers with
net/http/httptest - Setting up CI/CD test pipelines
- Comparing benchmark results across commits using
benchstatto detect performance regressions - Adding a fuzz corpus and property-based assertions to a parser or input validation function
- Configuring a GitHub Actions workflow that enforces Go test coverage thresholds on every pull request
Interface-Based Mocking
The idiomatic Go approach: define a minimal interface, write a fake that implements it, inject at the call site.