Go testing patterns including table-driven tests, subtests, benchmarks, fuzzing, and test coverage. Follows TDD methodology with idiomatic Go practices.
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# Go Testing Patterns
Comprehensive Go testing patterns for writing reliable, maintainable tests following TDD methodology.
## When to Activate
- Writing new Go functions or methods
- Adding test coverage to existing code
- Creating benchmarks for performance-critical code
- Implementing fuzz tests for input validation
- Following TDD workflow in Go projects
## TDD Workflow for Go
### The RED-GREEN-REFACTOR Cycle
```
RED → Write a failing test first
GREEN → Write minimal code to pass the test
REFACTOR → Improve code while keeping tests green
REPEAT → Continue with next requirement
```
### Step-by-Step TDD in Go
```go
// Step 1: Define the interface/signature
// calculator.go
package calculator
func Add(a, b int) int {
panic("not implemented") // Placeholder
}
// Step 2: Write failing test (RED)
// calculator_test.go
package calculator
import "testing"
func TestAdd(t *testing.T) {
got := Add(2, 3)
want := 5
if got != want {
t.Errorf("Add(2, 3) = %d; want %d", got, want)
}
}
// Step 3: Run test - verify FAIL
// $ go test
// --- FAIL: TestAdd (0.00s)
// panic: not implemented
// Step 4: Implement minimal code (GREEN)
…
The line at the top of this page pins the label git:20260512.6523792, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
GET https://markdownregistry.com/api/v1/artifacts/art_ngadvxlnltw67ixk
GET https://markdownregistry.com/api/v1/resolve?ref=hashgraph-online/awesome-codex-plugins/golang-testing
GET https://markdownregistry.com/api/v1/blob/2da1afcd9df6529392653cd450edc40eb8bbc0b073f3eda17a510f4b89411c1b
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
hashgraph-online/awesome-codex-plugins · .agents/skills/list-my-plugin/SKILL.md · Add a Codex plugin to the awesome-codex-plugins README as one correctly placed line, check it locally, and finish with…
hashgraph-online/awesome-codex-plugins · plugins/321zz321/computefirst-skill/skills/computefirst/SKILL.md · Use ComputeFirst for exact or deterministic computation when model-side arithmetic or manual transformation risks being…
hashgraph-online/awesome-codex-plugins · plugins/6Delta9/task-scheduler-codex-plugin/skills/task-planner/SKILL.md · Turn a list of goals, tasks, deadlines, and working constraints into a practical schedule with next actions and…
hashgraph-online/awesome-codex-plugins · plugins/6jeffr3y/burpsuite-mcp-bridge/skills/use-burpsuite-mcp-bridge/SKILL.md · Operate BurpSuite MCP Bridge for professional, authorized web testing. Use when Codex needs to inspect Burp…
affaan-m/ecc · .kiro/skills/golang-testing/SKILL.md · Go testing best practices including table-driven tests, test helpers, benchmarking, race detection, coverage analysis…
affaan-m/ecc · docs/es/skills/golang-testing/SKILL.md · Patrones de pruebas Go incluyendo pruebas basadas en tablas, subpruebas, benchmarks, fuzzing y cobertura de código…