Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
handlers
vendor/github.com
Gopkg.lock
Gopkg.toml
README.md
curls.txt
main.go

README.md

Unit Testing HTTP Handlers

Watch The Screencast

Go in 5 Minutes, episode 6.

This screencast shows two ways to quickly and effectively test your net/http handlers.

Screencast video: https://www.goin5minutes.com/screencast/episode_6_unit_testing_http_handlers/

goin5minutes.com

Our website is up and running! Right now, it houses a permanent list of all screencasts, but I'm planning to expand it with more auxiliary content.

Please sign up for our newsletter to get emails when new screencasts come out.

Outline

  1. Flash back to episode 0
  2. net/http/httptest & testsrv
  • pure handler vs. router & handler tests
  1. Example - an API server to wrap the Github API