Simplify chi.URLParam, call chi.URLParamFromCtx (#1168)
This way we avoid having two nearly identical implementations.
This commit is contained in:
parent
50ef4e4c31
commit
ae6be74691
1 changed files with 1 additions and 4 deletions
|
|
@ -9,10 +9,7 @@ import (
|
|||
|
||||
// URLParam returns the url parameter from a http.Request object.
|
||||
func URLParam(r *http.Request, key string) string {
|
||||
if rctx := RouteContext(r.Context()); rctx != nil {
|
||||
return rctx.URLParam(key)
|
||||
}
|
||||
return ""
|
||||
return URLParamFromCtx(r.Context(), key)
|
||||
}
|
||||
|
||||
// URLParamFromCtx returns the url parameter from a http.Request Context.
|
||||
|
|
|
|||
Loading…
Reference in a new issue