diff options
| author | Mathias Magnusson <mathias@magnusson.space> | 2026-01-24 00:33:11 +0100 |
|---|---|---|
| committer | Mathias Magnusson <mathias@magnusson.space> | 2026-01-24 00:33:11 +0100 |
| commit | d75bab2ba79d138547a0ea6d3b3be84a89b050a8 (patch) | |
| tree | d00eef48f0332380f66578e761f9d27611f53b66 /examples/basic.go | |
| parent | 8f29959b87b68e76aadbc32dfa00f938604b1f6d (diff) | |
| download | hh-d75bab2ba79d138547a0ea6d3b3be84a89b050a8.tar.gz | |
take `http.ResponseWriter` as part of parsed request
Diffstat (limited to 'examples/basic.go')
| -rw-r--r-- | examples/basic.go | 5 |
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) } |
