Changed comment for Param().
This commit is contained in:
parent
4f54ab4156
commit
653bae85f5
4
httpr.go
4
httpr.go
@ -196,8 +196,8 @@ func (rr *Router) ServeStatic(path string, root http.FileSystem) error {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Param returns a parameter (that is set like `/a/b/:key/d`) inside a path
|
// Param returns a URL parameter (that is set like `/a/b/:key/d`) with a key
|
||||||
// with a key or empty string if no such parameter found.
|
// or an empty string if no such parameter found.
|
||||||
func Param(r *http.Request, key string) string {
|
func Param(r *http.Request, key string) string {
|
||||||
if params := r.Context().Value(ParamsKey).(Params); params != nil {
|
if params := r.Context().Value(ParamsKey).(Params); params != nil {
|
||||||
return params[key]
|
return params[key]
|
||||||
|
Loading…
Reference in New Issue
Block a user