How To: Unit Test Your (HTTP) Handlers in Go

Prompted by a number of questions in the Go Slack community (and elsewhere!), I’ve written up a short article on how to:

  • Unit test your handlers
  • Create context.Contexts for testing with
  • Stub out database calls in your tests

I hope it’s useful, and happy to take feedback here.


This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.