Testing in Go: from basic to advanced
summary
Go testing techniques with runnable code: how to use t.Helper and t.Run subtests, table-driven tests and the common loop-variable bug that makes parallel subtests share the same value, and how that turned three 1s runs into 3s. Shows using -race to detect data races, build tags like // +build integration with -short to skip slow integration tests, how to implement global setup/teardown with TestMain, and forcing fresh runs with -count to bypass cached results.
AI-written summary · about
chapters (12)
- 0:00Introduction to testing
- 3:21Basic test functions
- 8:30Table-driven tests
- 11:31Parallel test execution
- 14:46Race condition detection
- 18:04Test data management
- 19:50Black-box testing
- 21:38Integration testing
- 24:28Test flags and build tags
- 26:16Test setup and teardown
- 28:28Test caching in Go
- 29:30Q&A








