Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Is that skill safe to install?
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
Are you the author of Golang Testing?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/karthikrshet-golang-testing)
---
name: golang-testing
description: "Write and fix tests in Go: write table-driven tests with t.Run subtests, mocking at boundaries, async tests and CI settings."
tags: [golang, testing]
---
# Golang Testing
## When to use
- Writing or reviewing Go tests
- Setting up a test suite
- Fixing slow or flaky tests
## Procedure
1. Write table-driven tests with t.Run subtests
2. Use t.Helper in helpers and t.Cleanup for teardown
3. Use httptest for handlers and fakes for interfaces
4. Run with -race and -count=1 in CI
5. Add fuzz tests (go test -fuzz) for parsers
## Checklist
- [ ] Race detector clean
- [ ] Golden files updated deliberately
## Anti-patterns
- Sleeping to wait for goroutines
- Testing unexported internals from another package