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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user