Vars returns the route variables for the current request, if any.
(r *http.Request)
| 428 | |
| 429 | // Vars returns the route variables for the current request, if any. |
| 430 | func 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 |
no outgoing calls