fixed test case no pass
This commit is contained in:
parent
b8890dd52c
commit
b362404749
@ -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()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user