From d75bab2ba79d138547a0ea6d3b3be84a89b050a8 Mon Sep 17 00:00:00 2001 From: Mathias Magnusson Date: Sat, 24 Jan 2026 00:33:11 +0100 Subject: take `http.ResponseWriter` as part of parsed request --- examples/basic.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'examples/basic.go') diff --git a/examples/basic.go b/examples/basic.go index 7f09d0f..d8ad6d7 100644 --- a/examples/basic.go +++ b/examples/basic.go @@ -12,7 +12,8 @@ import ( // Big bungus function here! // //hh:route GET /org/{orgID}/users -func adminUsersForm(w http.ResponseWriter, r struct { +func adminUsersForm(r struct { + w http.ResponseWriter raw *http.Request search string `hh:"form"` year int `hh:"optional,form"` @@ -21,7 +22,7 @@ func adminUsersForm(w http.ResponseWriter, r struct { banana uuid.UUID `hh:"optional,form"` nextURL string `hh:"optional,cookie,logout_next_url"` }) { - _, _ = w.Write([]byte("ahahaha")) + _, _ = r.w.Write([]byte("ahahaha")) slog.Info("get admin users form", "search", r.search, "offset", r.offset, "next-url", r.nextURL) } -- cgit v1.2.3