mirror of
https://github.com/kataras/iris.git
synced 2025-12-19 19:07:06 +00:00
Former-commit-id: d95be1456a78fbafd7ec5fec22f2066454eb76c6
This commit is contained in:
23
mvc/param.go
23
mvc/param.go
@@ -35,16 +35,21 @@ func getPathParamsForInput(params []macro.TemplateParam, funcIn ...reflect.Type)
|
||||
// }
|
||||
// }
|
||||
|
||||
for i, param := range params {
|
||||
if len(funcIn) <= i {
|
||||
return
|
||||
}
|
||||
funcDep, ok := context.ParamResolverByTypeAndIndex(funcIn[i], param.Index)
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
consumed := make(map[int]struct{})
|
||||
for _, in := range funcIn {
|
||||
for j, param := range params {
|
||||
if _, ok := consumed[j]; ok {
|
||||
continue
|
||||
}
|
||||
funcDep, ok := context.ParamResolverByTypeAndIndex(in, param.Index)
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
|
||||
values = append(values, funcDep)
|
||||
values = append(values, funcDep)
|
||||
consumed[j] = struct{}{}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user