mirror of https://github.com/go-gorm/gorm.git
Overwrite initiliazed slices as empty slices
This commit is contained in:
parent
3f18890ca4
commit
fa86433142
|
@ -30,7 +30,7 @@ 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))))
|
||||
dest.Set(reflect.MakeSlice(dest.Type(), 0, 0))
|
||||
|
||||
if destType.Kind() == reflect.Ptr {
|
||||
isPtr = true
|
||||
|
|
Loading…
Reference in New Issue