golang-testing
From affaan-m
Patrones de pruebas Go incluyendo pruebas basadas en tablas, subpruebas, benchmarks, fuzzing y cobertura de código. Sigue la metodología TDD con prácticas idiomáticas de Go.
Provides Go testing patterns and templates (table-driven tests, subtests, benchmarks, fuzzing, TDD workflow).
Use it when
- Writing new Go functions/methods with tests
- Adding test coverage to existing Go code
- Creating benchmarks for performance-critical Go code
- Implementing fuzz tests or following TDD red-green-refactor cycle
Skip it if
- Only relevant to Go projects, not other languages
- Content is documentation/examples, not an automated tool
Facts
- Repository
- affaan-m/ECC
- Status
- Actively maintained
- Last commit
- Source file
- .kiro/skills/golang-testing/SKILL.md
Source preview
The instructions Claude Code reads when this skill runs.
# Patrones de Pruebas Go
Patrones completos de pruebas Go para escribir pruebas confiables y mantenibles siguiendo la metodología TDD.
## Cuándo Activar
- Escribir nuevas funciones o métodos Go
- Agregar cobertura de pruebas a código existente
- Crear benchmarks para código crítico en rendimiento
- Implementar pruebas fuzz para validación de entradas
- Seguir el flujo de trabajo TDD en proyectos Go
## Flujo de Trabajo TDD para Go
### El Ciclo RED-GREEN-REFACTOR
```
RED → Escribir una prueba que falle primero
GREEN → Escribir el código mínimo para pasar la prueba
REFACTOR → Mejorar el código manteniendo las pruebas en verde
REPEAT → Continuar con el siguiente requisito
```
### TDD Paso a Paso en Go
```go
// Paso 1: Definir la interfaz/firma
// calculator.go
package calculator
func Add(a, b int) int {
panic("not implemented") // Marcador de posición
}
// Paso 2: Escribir prueba que falle (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)
}
}
// Paso 3: Ejecutar prueba - verificar FALLO
// $ go test
// --- FAIL: TestAdd (0.00s)
// panic: not implemented
// Paso 4: Implementar código mínimo (GREEN)
func Add(a, b int) int {
return a + b
}
// Paso 5: Ejecutar prueba - verificar PASA
// $ go test
// PView full source on GitHub →Other skills
django-tdd
★ 229,918Django testing strategies with pytest-django, TDD methodology, factory_boy, mocking, coverage, and testing Django REST Framework APIs.
affaan-mupdated 14d agoMITclickhouse-io
★ 229,918ClickHouse database patterns, query optimization, analytics, and data engineering best practices for high-performance analytical workloads.
affaan-mupdated 14d agoMITlaravel-patterns
★ 229,918Patrones de arquitectura Laravel, routing/controladores, Eloquent ORM, capas de servicio, colas, eventos, caché y API resources para aplicaciones en producción.
affaan-mupdated 14d agoMITverification-loop
★ 229,918Sistema de verificación completo para sesiones de Claude Code.
affaan-mupdated 14d agoMITstrategic-compact
★ 229,918Suggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction.
affaan-mupdated 14d agoMITfrontend-patterns
★ 229,918Patrones de desarrollo frontend para React, Next.js, gestión de estado, optimización de rendimiento y buenas prácticas de UI.
affaan-mupdated 14d agoMIT