Recorder — record what the handler wrote
rec := httptest.NewRecorder()
req := httptest.NewRequest("GET", "/hello?name=ada", nil)
myHandler(rec, req)
if rec.Code != 200 {
t.Errorf("got %d", rec.Code)
}
if !strings.Contains(rec.Body.String(), "ada") {
t.Error("missing ada")
}