golang-testing
Table-driven tests, subtests, benchmarks, fuzzing, and golden files for Go TDD workflows.
- Covers the RED-GREEN-REFACTOR cycle with step-by-step examples for writing tests before implementation
- Includes table-driven test patterns for comprehensive coverage, error cases, and parallel execution with
t.Run() - Provides benchmarking techniques for performance analysis, memory allocation tracking, and comparative benchmarks across input sizes
- Supports fuzzing with seed corpus and property-based testing for input validation (Go 1.18+)
- Includes mocking via interfaces, HTTP handler testing with
httptest, golden file comparisons, and coverage measurement strategies
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
More from affaan-m/everything-claude-code
security-review
Use this skill when adding authentication, handling user input, working with secrets, creating API endpoints, or implementing payment/sensitive features. Provides comprehensive security checklist and patterns.
7.9Kgolang-patterns
Idiomatic Go patterns, best practices, and conventions for building robust, efficient, and maintainable Go applications.
7.4Kcoding-standards
Baseline cross-project coding conventions for naming, readability, immutability, and code-quality review. Use detailed frontend or backend skills for framework-specific patterns.
6.7Kfrontend-patterns
Frontend development patterns for React, Next.js, state management, performance optimization, and UI best practices.
6.6Kbackend-patterns
Backend architecture patterns, API design, database optimization, and server-side best practices for Node.js, Express, and Next.js API routes.
6.6Kspringboot-patterns
Spring Boot architecture patterns, REST API design, layered services, data access, caching, async processing, and logging. Use for Java Spring Boot backend work.
5.6K