Intro to Test-Driven Development in Go
summary
Shows a concrete red green refactor workflow in Go: start with a failing test for a hello(name) function, hard‑code to pass, then generalize and refactor; uses go test for running, benchmarks, coverage and race detection. Demonstrates injecting interfaces and using generated fakes with counterfeiter to assert collaborator calls, and compares plain go assertions to richer matchers like kingcoat and go mega. Recommends deleting redundant tests to keep feedback fast and designs for explicit inputs to avoid global state.
AI-written summary · about
chapters (6)
- 0:00Introduction to TDD in Go
- 2:10What is test-driven development
- 5:21Using TDD in Go
- 14:09Why TDD helps developers
- 20:09TDD improves software design
- 27:14Q&A and resources








