go-testing - Go Testing Best Practices Guide
Expert guidance for writing maintainable and effective Go tests using table-driven tests, race detection, coverage, and mocking strategies.
Tags
Updated: 2026-03-19Typical Inputs
Typical Outputs
What this skill does
- Write table-driven tests
- Run race detection
- Measure test coverage
- Create test mocks
- Set up test fixtures
- Clean up test resources
- Run test subtests
- Test HTTP handlers
- Use test helpers
- Generate coverage reports
Inputs
- Go source code
- Test requirements
- Test scenarios
- Test fixtures
- Go packages
Outputs
- Test files
- Test results
- Coverage reports
- Mock implementations
- Golden test files
Requirements
- Go programming language
- Go testing framework
