MCPcopy
hub / github.com/gorilla/mux / Vars

Function Vars

mux.go:430–435  ·  view source on GitHub ↗

Vars returns the route variables for the current request, if any.

(r *http.Request)

Source from the content-addressed store, hash-verified

428
429// Vars returns the route variables for the current request, if any.
430func Vars(r *http.Request) map[string]string {
431 if rv := r.Context().Value(varsKey); rv != nil {
432 return rv.(map[string]string)
433 }
434 return nil
435}
436
437// CurrentRoute returns the matched route for the current request, if any.
438// This only works when called inside the handler of the matched route

Callers 2

ExampleSetURLVarsFunction · 0.85
TestContextMiddlewareFunction · 0.85

Calls

no outgoing calls

Tested by 2

ExampleSetURLVarsFunction · 0.68
TestContextMiddlewareFunction · 0.68