// Wrap wraps a normal http.Handler middleware, so it can be injected  into
// a chain. The context will be preserved and passed through intact.
Wrap wraps a normal http.Handler middleware, so it can be injected  into
a chain. The context will be preserved and passed through intact.
// Wrap wraps a normal http . Handler middleware so it can be injected into // a chain . The context will be preserved and passed through intact .
func Wrap(h func(http.Handler) http.Handler) C {
	return func(next Handler) Handler {
		return HandlerFunc(func(ctx context.Context, w http.ResponseWriter, r *http.Request) context.Context {
			var _ctx context.Context
			hNext := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
				_ctx = next.ServeHTTP(ctx, w, r)
			})
			result := h(hNext)
			result.ServeHTTP(w, r)
			return _ctx
		})
	}
}
func Wrap ( h func ( http . Handler ) http . Handler ) C { return func ( next Handler ) Handler { return HandlerFunc ( func ( ctx context . Context , w http . ResponseWriter , r * http . Request ) context . Context { var _ctx context . Context hNext := http . HandlerFunc ( func ( w http . ResponseWriter , r * http . Request ) { _ctx = next . ServeHTTP ( ctx , w , r ) } ) result := h ( hNext ) result . ServeHTTP ( w , r ) return _ctx } ) } }
Wrap wraps a normal http.Handler middleware, so it can be injected  into
a chain.
Wrap wraps a normal http . Handler middleware so it can be injected into a chain .