Skip to content

Commit

Permalink
fix linter warning
Browse files Browse the repository at this point in the history
  • Loading branch information
acoshift committed Sep 23, 2023
1 parent f25dc6d commit f403701
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions context.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,17 @@ func (ctx *Context) Value(key any) any {
}

// WithRequest returns new context with given request
func (ctx Context) WithRequest(r *http.Request) *Context {
ctx.Request = r
return &ctx
func (ctx *Context) WithRequest(r *http.Request) *Context {
nctx := *ctx
nctx.Request = r
return &nctx
}

// WithResponseWriter returns new context with given response writer
func (ctx Context) WithResponseWriter(w http.ResponseWriter) *Context {
ctx.w = w
return &ctx
func (ctx *Context) WithResponseWriter(w http.ResponseWriter) *Context {
nctx := *ctx
nctx.w = w
return &nctx
}

// WithContext returns new context with new request with given context
Expand Down

0 comments on commit f403701

Please sign in to comment.