Skip to content

Commit 948bec3

Browse files
authored
docs: Remove stale text from comment. (gorilla#568)
Comment for CurrentRoute claimed that setting the KeepContext option would propagate the Route even after the request. The KeepContext option is deprecated and has no effect.
1 parent 75dcda0 commit 948bec3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

mux.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,8 +435,7 @@ func Vars(r *http.Request) map[string]string {
435435
// CurrentRoute returns the matched route for the current request, if any.
436436
// This only works when called inside the handler of the matched route
437437
// because the matched route is stored in the request context which is cleared
438-
// after the handler returns, unless the KeepContext option is set on the
439-
// Router.
438+
// after the handler returns.
440439
func CurrentRoute(r *http.Request) *Route {
441440
if rv := r.Context().Value(routeKey); rv != nil {
442441
return rv.(*Route)

0 commit comments

Comments
 (0)