ref: v0.0.4 mux/params.go -rw-r--r-- 1.1 KiB
mux: remove mostly useless return value from Param

Previously the Param function returned a bool that indicated whether the
parameter was actually found in the request context.
After looking over the examples in this package, and existing code that
I had written using this package I realized that it was never used.
If you've written a route with a parameter, and you've written a handler
to apply to that route, it's not likely that you'll be checking that the
handler applies to the route very often.
Even if you do have a handler that applies to several routes and acts
depending on the parameters that exist on the routes, the ok bool was
redundant as the same information can be found by checking whether a
Value exists on the returned ParamInfo.
mux: add API to simplify path normalization
mux: support OPTIONS requests by default
mux: add route information to param metadata
mux: return param metadata
mux: factor out Param into own file