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 /cmd/generate/templates.go.tmpl | |
| parent | 8f29959b87b68e76aadbc32dfa00f938604b1f6d (diff) | |
| download | hh-d75bab2ba79d138547a0ea6d3b3be84a89b050a8.tar.gz | |
take `http.ResponseWriter` as part of parsed request
Diffstat (limited to 'cmd/generate/templates.go.tmpl')
| -rw-r--r-- | cmd/generate/templates.go.tmpl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd/generate/templates.go.tmpl b/cmd/generate/templates.go.tmpl index ff63337..77e8b7d 100644 --- a/cmd/generate/templates.go.tmpl +++ b/cmd/generate/templates.go.tmpl @@ -47,6 +47,10 @@ func hh_{{ $fn.Name }}(w http.ResponseWriter, r *http.Request) { parsed.{{ $f.Name }} = r {{ continue }} {{ end }} + {{ if eq $f.TypeDef "http.ResponseWriter" }} + parsed.{{ $f.Name }} = w + {{ continue }} + {{ end }} {{ $f.Name }}, {{ $f.Name }}Skipped := {{ extractorName $f.Extractor }}(r, {{ $f.NameInReq | quote }}) {{ if not $f.Optional }} if {{ $f.Name }}Skipped { @@ -62,7 +66,7 @@ func hh_{{ $fn.Name }}(w http.ResponseWriter, r *http.Request) { } } {{ end }} - {{ $fn.Name }}(w, parsed) + {{ $fn.Name }}(parsed) {{ if false }} {{ range $_, $f := $fn.RequestTypeFields -}} {{ $f.Name }}: {{ $f.Name }}, |
