gorilla/mux — pull request #53 by sqs (2014-04-23 18:53:59+00:00)
Title: PostMatchFunc: modify route variables after a successful match

This PR introduces a new PostMatchFunc that can be attached to a route. A PostMatchFunc allows you to intercept and modify the route variable map after a successful match is made.

It is useful when you want to be liberal in matching routes but normalize matched route variables. For example, you might want to normalize all blog post URL slugs to be lowercase, but still match uppercase slugs. Without PostMatchFunc, you would have to ensure that all code that retrieves the matched route variables from `mux.Vars(r)` would perform the correct normalization on the correct variables. With PostMatchFunc, that normalization is performed automatically.

PostMatchFunc is useful in conjuction with BuildVarsFunc at https://github.com/gorilla/mux/pull/52.