Skip to content

Commit

Permalink
docs: Remove stale text from comment. (#568)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
EricIO authored May 17, 2020
1 parent 75dcda0 commit 948bec3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions mux.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,7 @@ func Vars(r *http.Request) map[string]string {
// CurrentRoute returns the matched route for the current request, if any.
// This only works when called inside the handler of the matched route
// because the matched route is stored in the request context which is cleared
// after the handler returns, unless the KeepContext option is set on the
// Router.
// after the handler returns.
func CurrentRoute(r *http.Request) *Route {
if rv := r.Context().Value(routeKey); rv != nil {
return rv.(*Route)
Expand Down

0 comments on commit 948bec3

Please sign in to comment.