From 2fefd8cbbfd2141361f4d74bad24c19b724d8fbd Mon Sep 17 00:00:00 2001 From: BaoyangChai Date: Tue, 12 Feb 2019 18:53:34 +0800 Subject: [PATCH] update len --- orm/db.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/orm/db.go b/orm/db.go index e488a5ab..8e7e93bb 100644 --- a/orm/db.go +++ b/orm/db.go @@ -631,10 +631,10 @@ func (d *dbBase) Update(q dbQuerier, mi *modelInfo, ind reflect.Value, tz *time. } if find { - newSetNames := make([]string, 0, 0) + newSetNames := make([]string, 0, len(setNames)-1) newSetNames = append(setNames[0:index], setNames[index+1:]...) setNames = newSetNames - newSetValues := make([]interface{}, 0, 0) + newSetValues := make([]interface{}, 0, len(setNames)-1) newSetValues = append(setValues[0:index], setValues[index+1:]...) setValues = newSetValues