golang-testing

Solid

Go testing patterns including table-driven tests, subtests, benchmarks, fuzzing, and test coverage. Follows TDD methodology with idiomatic Go practices.

Testing & QA 159 stars 31 forks Updated 1 weeks ago MIT

Install

View on GitHub

Quality Score: 86/100

Stars 20%
73
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# 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) func Add(a, b int) int { return a + b } // Step 5: Run test - verify PASS // $ go test // PASS // Step 6: Refactor if needed, verify tests still pass ``` ## Table-Driven Tests The standard pattern for Go tests. Enables comprehensive coverage with minimal code. ```go func TestAdd(t *testing.T) { tests := [...

Details

Author
arabicapp
Repository
arabicapp/everything-claude-code
Created
5 months ago
Last Updated
1 weeks ago
Language
JavaScript
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category

Testing & QA Listed

golang-testing

Go testing patterns — table-driven tests, subtests, benchmarks, fuzzing, and coverage, following TDD. Use this skill whenever writing or fixing Go tests (`*_test.go`), adding coverage to existing code, benchmarking hot paths, fuzzing input validation, or following the RED-GREEN-REFACTOR cycle in a Go project. Use proactively when touching Go code that lacks tests.

0 Updated yesterday
sardonyx0827
Testing & QA Solid

golang-testing

Provides a comprehensive guide for writing production-ready Golang tests. Covers table-driven tests, test suites with testify, mocks, unit tests, integration tests, benchmarks, code coverage, parallel tests, fuzzing, fixtures, goroutine leak detection with goleak, snapshot testing, memory leaks, CI with GitHub Actions, and idiomatic naming conventions. Use this whenever writing tests, asking about testing patterns or setting up CI for Go projects. Essential for ANY test-related conversation in Go.

0 Updated today
guynhsichngeodiec
Testing & QA Listed

go-test

When the user wants to design, implement, debug, or optimize Go tests using the standard testing package, testify, and related Go ecosystem libraries. Use when the user mentions "go test," "table-driven tests," "t.Run," "subtests," "testify," "require / assert," "go test -race," "go test -bench," "go test -fuzz," "TestMain," "t.Cleanup," "httptest.Server," or "go-cmp." For JS/TS see jest-vitest. For Python see pytest. For Java see junit-testng. For .NET see xunit-nunit.

1 Updated yesterday
aks-builds