~/talk

Advanced Testing Techniques in Go

Talkat GoLab 2019 · 2019-10-20..10-22· [testing, go]
links:none on file
slides:none on file

Argues that Go tests succeed when code is structured for DI and small internal interfaces, showing examples: swapping Redis and Memcache by implementing a Store interface, replacing Kafka/NSQ with a distilled consumer/producer API to avoid interface pollution, and injecting time via functions rather than globals. Recommends avoiding exported channels in public APIs, prefers synchronous methods, and demonstrates HTTP testing with httptest.NewRecorder and table-driven tests plus stateful flows using a cookie jar and real databases bootstrapped via docker-entrypoint-initdb.d.

AI-written summary · about

  1. 0:00Why testing matters
  2. 2:51Structuring code for tests
  3. 7:50Dependency injection in Go
  4. 9:36Testing channels in Go
  5. 13:08Interfaces and testing
  6. 18:30Testing strategy approach
  7. 22:55HTTP testing techniques
  8. 27:15Docker for database tests
  9. 30:32Testing as communication
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.