Skip to content

Commit 10162fd

Browse files
committed
docs(context): document WrapM per-request invocation behavior
1 parent e4464c7 commit 10162fd

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

context.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,9 @@ func WrapH(h http.Handler) HandlerFunc {
446446

447447
// WrapM is an adapter for wrapping http.Handler middleware and returns a [MiddlewareFunc] function.
448448
// The route parameters are being accessed by the wrapped handler through the context.
449+
//
450+
// Note that m is invoked on every request, so any setup it does before returning
451+
// its handler runs per request.
449452
func WrapM(m func(http.Handler) http.Handler) MiddlewareFunc {
450453
return func(next HandlerFunc) HandlerFunc {
451454
return wrapM{next: next, m: m}.handle

0 commit comments

Comments
 (0)