MCPcopy
hub / github.com/go-chi/chi / URLParamFromCtx

Function URLParamFromCtx

context.go:18–23  ·  view source on GitHub ↗

URLParamFromCtx returns the url parameter from a http.Request Context.

(ctx context.Context, key string)

Source from the content-addressed store, hash-verified

16
17// URLParamFromCtx returns the url parameter from a http.Request Context.
18func URLParamFromCtx(ctx context.Context, key string) string {
19 if rctx := RouteContext(ctx); rctx != nil {
20 return rctx.URLParam(key)
21 }
22 return ""
23}
24
25// RouteContext returns chi's routing Context object from a
26// http.Request Context.

Callers 1

bigMuxFunction · 0.85

Calls 2

RouteContextFunction · 0.85
URLParamMethod · 0.80

Tested by 1

bigMuxFunction · 0.68