summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMathias Magnusson <mathias@magnusson.space>2026-01-24 00:33:11 +0100
committerMathias Magnusson <mathias@magnusson.space>2026-01-24 00:33:11 +0100
commitd75bab2ba79d138547a0ea6d3b3be84a89b050a8 (patch)
treed00eef48f0332380f66578e761f9d27611f53b66 /examples
parent8f29959b87b68e76aadbc32dfa00f938604b1f6d (diff)
downloadhh-d75bab2ba79d138547a0ea6d3b3be84a89b050a8.tar.gz
take `http.ResponseWriter` as part of parsed request
Diffstat (limited to 'examples')
-rw-r--r--examples/basic.go5
1 files changed, 3 insertions, 2 deletions
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)
}