Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Mock object for Go http.ResponseWriter

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 .gitattributes
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Makefile
Octocat-spinner-32 README.rst
Octocat-spinner-32 mockhttp_test.go
Octocat-spinner-32 mockrequest.go
Octocat-spinner-32 mockresponsewriter.go

mockhttp.go -- Go package for unit testing HTTP serving

Unit testing HTTP services written in Go means you need to call their ServeHTTP receiver. For this, you need something that fulfills the http.ResponseWriter interface, and you need to populate a http.Request struct with suitable-looking data. mockhttp.go helps you do these tasks, without excessive copy-pasting.

See mockhttp_test.go for an example of usage.

Something went wrong with that request. Please try again.