golang-unit-testing
Installation
SKILL.md
Golang Unit Testing
Teste comportamento de risco, não detalhes privados. Prefira table-driven claros a suítes frágeis.
Stack e escopo
| Peça | Papel |
|---|---|
| testing | Test*, t.Run, t.Helper |
| httptest | Requests HTTP in-memory |
| Gin | gin.New() / mode test / handlers reais |
| fakes | Ports na borda (repo, clock, bus) |
Use testify só se o projeto já depender dele. Concorrência: rode com -race nos pacotes tocados.