overwrite initiliazed slice as empty slice
This commit is contained in:
parent
5663048f13
commit
77666f6309
@ -30,7 +30,9 @@ func Query(scope *Scope) {
|
||||
if kind := dest.Kind(); kind == reflect.Slice {
|
||||
isSlice = true
|
||||
destType = dest.Type().Elem()
|
||||
dest.Set(reflect.Indirect(reflect.New(reflect.SliceOf(destType))))
|
||||
if !dest.IsNil() {
|
||||
dest.Set(reflect.MakeSlice(reflect.Indirect(reflect.New(reflect.SliceOf(destType))).Type(), 0, 0))
|
||||
}
|
||||
|
||||
if destType.Kind() == reflect.Ptr {
|
||||
isPtr = true
|
||||
|
Loading…
x
Reference in New Issue
Block a user