diff --git a/service/repositories/order.go b/service/repositories/order.go index faffca77..9d16f295 100644 --- a/service/repositories/order.go +++ b/service/repositories/order.go @@ -1770,7 +1770,7 @@ func (d *defaultOrder) OrderDetailHandler(ctx context.Context, orderInfo *gmodel Metadata: orderMetadata, } // 购物车对应商品 - var shoppingCartSnapshotDataMap = make(map[int64]gmodel.FsShoppingCartData) + var shoppingCartSnapshotDataMap = make(map[int64]gmodel.FsShoppingCartData, len(shoppingCartSnapshot)) for _, shoppingCartSnapshotValue := range shoppingCartSnapshot { var shoppingCartSnapshotData gmodel.FsShoppingCartData snapshot, err := d.OrderShoppingCartSnapshotHandler(ctx, shoppingCartSnapshotValue.Snapshot)