From fa864331428595f6d43232c3c2043e626b79aa7b Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Sat, 1 Aug 2015 09:06:06 +0800 Subject: [PATCH] Overwrite initiliazed slices as empty slices --- callback_query.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/callback_query.go b/callback_query.go index 4de911e8..387e813d 100644 --- a/callback_query.go +++ b/callback_query.go @@ -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