Built-In Testing in Go is More Than Just Passable
summary
Claim: Go's standard library testing is enough to get fast, reviewable tests rather than adding frameworks. Uses the built-in testing.T API with t.Run subtests and table-driven tests, plus a mock HTTP server (mux) for unit tests that exercise JSON marshaling without hitting real APIs. The pagerduty Go SDK gets tests for every endpoint, replacing manual PR testing; moving from many repetitive lines to a single table cuts boilerplate and keeps tests fast and deterministic.
AI-written summary · about
chapters (9)
- 0:00Built-in Go testing intro
- 2:02Why testing matters in Go
- 8:46Go's testing philosophy
- 12:40Unit vs integration testing
- 14:29Writing Go tests
- 19:32Live Go test demo
- 28:05Table-driven testing in Go
- 34:47Testing real-world Go libraries
- 40:52Conclusion
related talks
01h 32mTesting in Go: 101
34mAdvanced Testing Techniques in Go
44mGo Testing By Example
35mTest like a ninja with Go
34mHow NOT to Write a Test in Go
28mIntro to Test-Driven Development in Go
48mClimbing the Testing Pyramid: From Real Service to Interface Mocks in Go
20mWriting Microservice Integration Tests in Go (Finally)
