1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-18 02:17:05 +00:00

fix #2158 and more

This commit is contained in:
Gerasimos (Makis) Maropoulos
2023-07-08 02:08:18 +03:00
parent 757e7fe61b
commit 6add1ba49b
79 changed files with 551 additions and 467 deletions

View File

@@ -253,7 +253,7 @@ func isPayloadType(in reflect.Type) bool {
func getBindingsForFunc(fn reflect.Value, dependencies []*Dependency, disablePayloadAutoBinding bool, paramsCount int) []*binding {
fnTyp := fn.Type()
if !isFunc(fnTyp) {
panic("bindings: unresolved: not a func type")
panic(fmt.Sprintf("bindings: unresolved: no a func type: %#+v", fn))
}
n := fnTyp.NumIn()
@@ -294,7 +294,7 @@ func getBindingsForFunc(fn reflect.Value, dependencies []*Dependency, disablePay
func getBindingsForStruct(v reflect.Value, dependencies []*Dependency, markExportedFieldsAsRequired bool, disablePayloadAutoBinding bool, matchDependency DependencyMatcher, paramsCount int, sorter Sorter) (bindings []*binding) {
typ := indirectType(v.Type())
if typ.Kind() != reflect.Struct {
panic("bindings: unresolved: no struct type")
panic(fmt.Sprintf("bindings: unresolved: not a struct type: %#+v", v))
}
// get bindings from any struct's non zero values first, including unexported.