mirror of
https://github.com/kataras/iris.git
synced 2025-12-21 11:57:02 +00:00
next version preparation: hero: add a Container.Inject method to inject values outside of HTTP lifecycle, e.g. a database may be used by other services outside of Iris, the hero container (and API's Builder.GetContainer()) should provide it.
Former-commit-id: 89863055a3a3ab108a3f4b753072a35321a3a193
This commit is contained in:
@@ -125,13 +125,15 @@ func getBindingsFor(inputs []reflect.Type, deps []*Dependency, paramsCount int)
|
||||
// Therefore, count the inputs that can be path parameters first.
|
||||
shouldBindParams := make(map[int]struct{})
|
||||
totalParamsExpected := 0
|
||||
for i, in := range inputs {
|
||||
if _, canBePathParameter := context.ParamResolvers[in]; !canBePathParameter {
|
||||
continue
|
||||
}
|
||||
shouldBindParams[i] = struct{}{}
|
||||
if paramsCount != -1 {
|
||||
for i, in := range inputs {
|
||||
if _, canBePathParameter := context.ParamResolvers[in]; !canBePathParameter {
|
||||
continue
|
||||
}
|
||||
shouldBindParams[i] = struct{}{}
|
||||
|
||||
totalParamsExpected++
|
||||
totalParamsExpected++
|
||||
}
|
||||
}
|
||||
|
||||
startParamIndex := paramsCount - totalParamsExpected
|
||||
|
||||
Reference in New Issue
Block a user