Skip to content

Commit

Permalink
set updated ctx to Request
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasJenicek committed Oct 1, 2024
1 parent be32331 commit 89a072e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions _examples/golang-basics/example.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions _examples/golang-imports/api.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions server.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ func (s *{{$serviceName}}) ServeHTTP(w http.ResponseWriter, r *http.Request) {
ctx = context.WithValue(ctx, HTTPRequestCtxKey, r)
ctx = context.WithValue(ctx, ServiceNameCtxKey, "{{.Name}}")

r = r.WithContext(ctx)

var handler func(ctx context.Context, w http.ResponseWriter, r *http.Request)
switch r.URL.Path {
{{- range $_, $method := $service.Methods}}
Expand Down

0 comments on commit 89a072e

Please sign in to comment.