~samwhited/mux

ref: v0.0.4 mux/norm.go -rw-r--r-- 2.4 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: rename new normalization functions

Renaming "CanonicalPath" to "Path" and "WithParameter" to "WithParam"
keeps the identifiers short and is more consistent with the docs and
other identifiers in the package.
mux: add API to simplify path normalization
Next