golang-testing
Go testing best practices including table-driven tests, test helpers, benchmarking, race detection, coverage analysis, and integration testing patterns. Use when writing or improving Go tests.
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
- Testing Framework
- Table-Driven Tests
- Test Helpers
- Test Fixtures
- Race Detection
- Coverage Analysis
- Basic Coverage
This skill provides comprehensive Go testing patterns extending common testing principles with Go-specific idioms. Use the standard go test with table-driven tests as the primary pattern. The idiomatic Go testing pattern: Benefits: Easy to add new test cases Clear test case documentation Parallel test execution with t.Parallel() Isolated subtests with t.Run() Use t.Helper() to mark helper functions: Benefits: Correct line numbers in test failures Reusable test utilities Cleaner test code Use t.Cleanup() for resource cleanup: Always run tests with the -race flag to detect data races: In CI/CD: Why: Detects concurrent access bugs Prevents production race conditions Minimal performance overhead in tests Run benchmarks: Compare benchmarks: Run integration tests: 1. Use t.Parallel() for independent tests 2. Use testing.Short() to skip slow tests 3. Use t.TempDir() for temporary directories 4. Use t.Setenv() for environment variables 5. Avoid init() in test files 6. Keep tests focused - one behavior per test 7. Use meaningful test names - describe what's being tested Writing new Go tests Improving test coverage Setting up test infrastructure Debugging flaky tests Optimizing test performa
This is an excerpt. Refer to the complete source and its current requirements.
- Source repository
- affaan-m/ECC
- Source file
- .kiro/skills/golang-testing/SKILL.md
- Fixed revision
- d2ef2680594f9a17526a6e1a2e18b3d242c5d17b
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-09T14:01:48.602Z.
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.