RouteContext returns chi's routing Context object from a http.Request Context.
(ctx context.Context)
| 25 | // RouteContext returns chi's routing Context object from a |
| 26 | // http.Request Context. |
| 27 | func RouteContext(ctx context.Context) *Context { |
| 28 | val, _ := ctx.Value(RouteCtxKey).(*Context) |
| 29 | return val |
| 30 | } |
| 31 | |
| 32 | // NewRouteContext returns a new routing Context object. |
| 33 | func NewRouteContext() *Context { |