go-testing-mistakes
CommunityMaster Go testing without common mistakes.
Authorv0lka
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Go testing mistakes cause flaky tests, slow feedback, and brittle test suites. This guide helps teams identify and fix these pitfalls across unit, benchmark, and integration tests.
Core Features & Use Cases
- Test categorization: apply build tags, env vars, and short mode to separate test kinds and speeds.
- Race detection and execution: consistently run tests with -race and leverage parallel subtests with t.Parallel.
- Table-driven tests: implement robust table-driven tests with proper variable capture and subtests.
- Avoid sleeps and ensure determinism: replace time.Sleep with polling or channel synchronization; inject time dependencies for deterministic tests.
- Benchmark discipline: structure benchmarks with proper timer control, multiple runs, and guard against compiler optimizations.
- Utilize testing utilities: use httptest and iotest for HTTP and IO testing.
Quick Start
Audit your current Go tests and apply the recommended patterns to improve correctness and reliability.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: go-testing-mistakes Download link: https://github.com/v0lka/skills/archive/main.zip#go-testing-mistakes Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 510,000+ vetted skills library on demand.