Golang Testing
Go testing patterns for table-driven tests, subtests, benchmarks, fuzzing, and coverage, following a strict RED-GREEN-REFACTOR TDD cycle.
- CCM score
- 67 of 100
- skills.sh installs
- 16.5K
- GitHub stars
- 312.6K
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers the TDD loop with a worked example: placeholder signature, failing test, minimal implementation, then refactor
- Includes table-driven tests with error cases, parallel subtests,
t.Helperandt.Cleanuphelpers, andt.TempDirfile handling - Adds golden-file testing under
testdata/with an-updateflag and interface-based mocking for dependencies - Designed for Go developers writing new functions or adding coverage to existing code without a separate test framework
Install
$ npx -y skills add affaan-m/ecc --skill golang-testing -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
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
// 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
Details
- Repository
- github.com/affaan-m/ecc
- Categories
- Testing & QA, Go
- First seen
- Jul 14, 2026
Questions
What does the golang-testing skill help with?
The golang-testing skill covers Go testing patterns, including table-driven tests, subtests, benchmarks, fuzzing, and test coverage. It follows TDD methodology with idiomatic Go practices, guiding a red-green-refactor cycle.
How do I install the golang-testing skill?
Run npx -y skills add affaan-m/ecc --skill golang-testing -y in your project. Once installed, the agent can write Go table-driven tests, subtests, benchmarks, fuzz tests, and coverage checks.
When should I use the golang-testing skill?
Use it when writing Go tests, such as table-driven cases, subtests, benchmarks, fuzzing, or coverage. It also applies when adding test coverage to existing Go code or following a TDD workflow in a Go project.
Where does golang-testing rank in the Testing and QA category?
The golang-testing skill sits in the Testing and QA category and ranks in the top 50 on its category page. Other skills in the category include tdd, test-driven-development, and webapp-testing.
More from affaan-m/ecc
All 257- Python Patterns15.6K
- Springboot Patterns15.5K
- Api Design15.3K
- Market Research15.3K
- Postgres Patterns15.2K
- Frontend Slides15.2K
- Django Patterns15.2K
- Tdd Workflow15K
- Rust Testing14.8K
- Prompt Optimizer14.5K
- Java Coding Standards14.5K
- Django Security14.4K
- Python Testing14.3K
- Laravel Security14.3K
- Android Clean Architecture14.3K
- Article Writing14.3K
- Cpp Coding Standards14.3K
- Springboot Security14.2K
- Liquid Glass Design14.2K
- Database Migrations14.1K
- E2e Testing14.1K
- Strategic Compact14K
- Laravel Patterns13.8K
- Verification Loop13.6K
Similar to Golang Testing
More Testing & QAtdd-workflowaffaan-m/ecc15K installsStrict TDD cycle enforcing RED-GREEN-refactor with 80%+ coverage across unit, integration, and E2E tests.
rust-testingaffaan-m/ecc14.8K installsRust testing patterns covering unit, integration, async, property-based, and mocked tests under a TDD workflow.
test-driven-developmentbobmatnyc/claude-mpm-skills412 installsLanguage-agnostic TDD guide covering red-green-refactor, test structure, mocking, and coverage targets for any stack.
tddmattpocock/skills1.3M installsTest-first development loop with rules for seams, test quality, and vertical slicing.
go-testingcxuu/golang-skills1.5K installsGo test-writing guide that covers table-driven tests, subtests, helpers, and cmp.Diff assertions, with clear failure-message rules.