no need to combine sub-router params any more
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
fcf545c27c
commit
bc96af40db
12
router.go
12
router.go
|
@ -50,16 +50,6 @@ func (r Router) Handler(ctx context.Context, request *Request) *Response {
|
|||
return nil
|
||||
}
|
||||
|
||||
// as we may be a sub-router, check for existing stashed params
|
||||
// and combine with that map if found.
|
||||
priorParams := RouteParams(ctx)
|
||||
for k, v := range priorParams {
|
||||
if k == subrouterPathKey {
|
||||
continue
|
||||
}
|
||||
params[k] = v
|
||||
}
|
||||
|
||||
return handler(context.WithValue(ctx, routeParamsKey, params), request)
|
||||
}
|
||||
|
||||
|
@ -114,8 +104,6 @@ func RouteParams(ctx context.Context) map[string]string {
|
|||
return nil
|
||||
}
|
||||
|
||||
const subrouterPathKey = "subrouter_path"
|
||||
|
||||
type routeParamsKeyType struct{}
|
||||
|
||||
var routeParamsKey = routeParamsKeyType{}
|
||||
|
|
Reference in New Issue