golang-testing
Skill1 starsChanged 5 months agoMITView on GitHub
Golang testing strategy using the standard testing package, table-driven tests, subtests, HTTP tests, fuzzing, race detection, coverage, examples, integration boundaries, deterministic concurrency tests, and handwritten test doubles. Use when writing, reviewing, debugging, or organizing Go tests and test suites.
30 other projects use a version of this.
Adopted by
Most recently taken up by
- samber/cc-skills-golangtheir own version, first seen Oct 1, 2026
- imMamdouhaboammar/tiktok-growth-automation-meshtheir own version, first seen Oct 1, 2026
- templetongroup/radianttheir own version, first seen Sep 17, 2026
- rzisso/golang-skillstheir own version, first seen Sep 16, 2026
- bjornjee/skillstheir own version, first seen Sep 8, 2026
- idexal/idexal-skillstheir own version, first seen Aug 26, 2026
Used with
Projects with it also use golang-error-handling, golang-grpc and 5 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
guynhsichngeodiecSkillgolang-error-handling
Idiomatic Golang error handling — creation, wrapping with %w, errors.Is/As, errors.Join, custom error types, sentinel errors, panic/recover, the single handling rule, structured logging with slog, HTTP request logging middleware, and samber/oops for production errors. Built to make logs usable at scale with log aggregation 3rd-party tools. Apply when creating, wrapping, inspecting, or logging errors in Go code.
Also in 6 projects that use this
guynhsichngeodiecSkillgolang-grpc
Provides gRPC usage guidelines, protobuf organization, and production-ready patterns for Golang microservices. Use when implementing, reviewing, or debugging gRPC servers/clients, writing proto files, setting up interceptors, handling gRPC errors with status codes, configuring TLS/mTLS, testing with bufconn, or working with streaming RPCs.
Also in 6 projects that use this
- +5 more from guynhsichngeodiec
Other versions30 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 30
- samber/cc-skills-golang★ 3.4ksame name
- xu-xiang/everything-claude-code-zh★ 2ksame name
- loulanyue/awesome-claude-notes★ 272same name
- tpavanipradeep/everything-claude-code★ 134same name
- templetongroup/radiant★ 113same name
- Jamkris/everything-gemini-code★ 87same name
- codelably/harmony-claude-code★ 43same name
- jmrplens/gitlab-mcp-server★ 43same name
- jmrplens/libgen-mcp★ 19same name
- castle-x/skills-x★ 18same name
20 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository14 other files it gives its agents.
- AGENTS.mdAGENTS.md
- golang-architectureSkill
- golang-code-qualitySkill
- golang-concurrencySkill
- golang-databaseSkill
- golang-dependenciesSkill
- golang-goplsSkill
- golang-observabilitySkill
- golang-performanceSkill
- golang-projectSkill
- golang-refactoringSkill
- golang-securitySkill
- golang-toolingSkill
- golang-troubleshootingSkill
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 7 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 26 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 25
Read the public contract and existing tests before choosing cases.
- Distinctive: line 27
Use table-driven tests when cases share behavior.
- Distinctive: line 28
Prefer focused handwritten fakes at consumer interfaces over mocking frameworks.
- Very specific: line 30
Run focused tests first, then go test ./....
- Distinctive: line 34
Do not chase coverage percentages at the expense of meaningful assertions.
- Distinctive: line 35
Keep tests independent of execution order and global mutable state.
- Very specific: line 36
Use t.Cleanup for resources and t.Helper for reusable assertions.
- Distinctive: line 37
Use build tags or separate infrastructure for integration tests when they require external services.
- Very specific: line 39
Add benchmarks only for explicit performance questions.
- Distinctive: line 43
Test command and flag reference: go-test.md
“Common” is measured: kept by at least 6 in 10 of the 26 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Persona: You are a Go engineer who treats tests as executable specifications. Test observable behavior and failure contracts rather than implementation details.
Go Testing
Workflow
- Read the public contract and existing tests before choosing cases.
- Cover success, boundaries, invalid inputs, dependency failures, cancellation, and state transitions that matter.
- Use table-driven tests when cases share behavior; use named subtests when they improve diagnosis.
- Prefer focused handwritten fakes at consumer interfaces over mocking frameworks.
- Make time, randomness, I/O, and concurrency controllable.
- Run focused tests first, then
go test ./...; add-racefor concurrent code.
Principles
- Do not chase coverage percentages at the expense of meaningful assertions.
- Keep tests independent of execution order and global mutable state.
- Use
t.Cleanupfor resources andt.Helperfor reusable assertions. - Use build tags or separate infrastructure for integration tests when they require external services.
- Fuzz parsers, decoders, validators, and boundary-heavy functions with stable invariants.
- Add benchmarks only for explicit performance questions; interpret them with
golang-performance.
Conditional references
- Test command and flag reference: go-test.md
- HTTP handlers, clients, and middleware: http-testing.md
- Timeouts and reusable helpers: helpers.md
Verification
go test ./...
go test -race ./...
go test -run TestName ./path/to/package
go test -fuzz FuzzName ./path/to/package→ See golang-concurrency for lifecycle invariants, golang-database for database integration tests, and golang-project for CI execution.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

