1
0
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:
Gerasimos (Makis) Maropoulos
2019-03-01 14:10:07 +02:00
parent 444a4a0363
commit df3a68255c
3 changed files with 25 additions and 11 deletions

View File

@@ -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