MCPcopy
hub / github.com/gin-gonic/gin / WrapH

Function WrapH

utils.go:54–58  ·  view source on GitHub ↗

WrapH is a helper function for wrapping http.Handler and returns a Gin middleware.

(h http.Handler)

Source from the content-addressed store, hash-verified

52
53// WrapH is a helper function for wrapping http.Handler and returns a Gin middleware.
54func WrapH(h http.Handler) HandlerFunc {
55 return func(c *Context) {
56 h.ServeHTTP(c.Writer, c.Request)
57 }
58}
59
60// H is a shortcut for map[string]any
61type H map[string]any

Callers 1

TestWrapFunction · 0.85

Calls 1

ServeHTTPMethod · 0.45

Tested by 1

TestWrapFunction · 0.68