fixed test case no pass

This commit is contained in:
double 2019-06-16 16:26:30 +08:00
parent b8890dd52c
commit b362404749

View File

@ -155,15 +155,11 @@ func (scope *Scope) GetModelStruct() *ModelStruct {
return &modelStruct return &modelStruct
} }
if reflect.ValueOf(scope.Value).Kind() != reflect.Ptr { if reflect.ValueOf(scope.Value).Kind() == reflect.Ptr && reflect.ValueOf(scope.Value).Elem().Kind() == reflect.Interface {
panic("results argument must be a ptr or slice") // For reflect params
}
if reflect.ValueOf(scope.Value).Elem().Kind() == reflect.Interface {
// for reflect params
reflectType = reflect.ValueOf(scope.Value).Elem().Elem().Type() reflectType = reflect.ValueOf(scope.Value).Elem().Elem().Type()
} else { } else {
// for struct params // For struct params
reflectType = reflect.ValueOf(scope.Value).Type() reflectType = reflect.ValueOf(scope.Value).Type()
} }