golang-testing
golang testing
What it does
- gotests: go install github.com/cweill/gotests/gotests@latest
- Testing concurrent code with time-based operations (time.Sleep, time.After, time.Ticker)
- When race conditions need to be reproducible
- When tests are flaky due to timing issues
- time.Sleep advances synthetic time instantly when the goroutine blocks
- time.After fires when synthetic time reaches the duration
- All goroutines run to blocking points before time advances
Requirements & configuration
- 1. Table-driven tests MUST use named subtests -- every test case needs a name field passed to t.Run
- When race conditions need to be reproducible
- When a test, benchmark, or fuzz target needs to persist files for inspection, use ArtifactDir() instead of ad-hoc paths or repo-local output.
- See samber/cc-skills-golang@golang-stretchr-testify skill for detailed testify API (assert, require, mock, suite)
Configuration: GOEXPERIMENT
Derived from the skill's own SKILL.md documentation · extracted 2026-07-23
golang-testing FAQ
What does the golang-testing skill do?
Production-ready Golang tests — table-driven tests, testify suites and mocks, parallel tests, fuzzing, fixtures, goroutine leak detection with goleak, snapshot testing, code coverage, integration tests, idiomatic test naming. Use when writing or reviewing Go tests, choosing a testing approach, setting up Go test CI, or debugging flaky/slow tests. For testify-specific APIs see `samber/cc-skills-golang@golang-stretchr-testify`; for measurement methodology see `samber/cc-skills-golang@golang-benchmark`. gotests: go install github.com/cweill/gotests/gotests@latest Testing concurrent code with time-based operations (time.Sleep, time.After, time.Ticker)
What does golang-testing require?
1. Table-driven tests MUST use named subtests -- every test case needs a name field passed to t.Run When race conditions need to be reproducible When a test, benchmark, or fuzz target needs to persist files for inspection, use ArtifactDir() instead of ad-hoc paths or repo-local output. See samber/cc-skills-golang@golang-stretchr-testify skill for detailed testify API (assert, require, mock, suite) Configuration keys: GOEXPERIMENT.
How do I install golang-testing?
Run: npx -y skills add https://github.com/samber/cc-skills-golang --skill golang-testing --agent claude-code — the source lives at github.com/samber/cc-skills-golang.
Maintain golang-testing?
Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.
[](https://getagentictools.com/skills/samber-cc-skills-golang-golang-testing?ref=badge) npx agentictools info skills/samber-cc-skills-golang-golang-testing The second line is the CLI lookup for this page — handy in READMEs and docs.