The golang-testing skill provides Go developers with comprehensive testing patterns including table-driven tests, subtests, benchmarks, fuzzing, and test coverage analysis, following test-driven development (TDD) methodology and idiomatic Go practices. It solves the problem of writing reliable, maintainable tests by offering step-by-step TDD workflows, code examples, and standardized patterns that developers can apply when writing new Go functions, adding coverage to existing code, or implementing performance benchmarks. The skill is designed for Go developers at any level who want to follow best practices and improve code quality through systematic testing.

skills.sh installs
8.4K
GitHub stars
229.1K
last updated
Jul 14, 2026

Install

$ npx -y skills add affaan-m/everything-claude-code --skill golang-testing --agent claude-code

Installs into .claude/skills of the current project.

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

Sponsors

Details

Repository
github.com/affaan-m/everything-claude-code
Categories
Testing & QA, Go

More from affaan-m/everything-claude-code

All 256
1affaan-m avatartdd-workflowaffaan-m/everything-claude-codetdd workflow6.9Kskills.sh installs
2affaan-m avatarpython-testingaffaan-m/everything-claude-codepython testing6.6Kskills.sh installs
3vinvcn avatartddvinvcn/mattpocock-skills-zh-cn测试驱动开发。适用于用户想用先写测试的方式构建功能或修复缺陷、提到 “red-green-refactor”,或需要集成测试时。6.1Kskills.sh installs
4affaan-m avatarspringboot-tddaffaan-m/everything-claude-codespringboot tdd6Kskills.sh installs
5affaan-m avatardjango-tddaffaan-m/everything-claude-codedjango tdd5.9Kskills.sh installs
6openai avatarplaywright-interactiveopenai/skillsPersistent browser and Electron interaction through `js_repl` for fast iterative UI debugging.5.7Kskills.sh installs