From 51dc6ba05b95ad96b8bde78ec38a6c7b6e21eea8 Mon Sep 17 00:00:00 2001 From: cuishuang Date: Fri, 4 Oct 2024 20:24:05 +0800 Subject: [PATCH] fix: fix slice init length Signed-off-by: cuishuang --- internal/pkg/infrastructure/postgres/scheduleactionrecord.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/pkg/infrastructure/postgres/scheduleactionrecord.go b/internal/pkg/infrastructure/postgres/scheduleactionrecord.go index db1b91187c..d2d154c07c 100644 --- a/internal/pkg/infrastructure/postgres/scheduleactionrecord.go +++ b/internal/pkg/infrastructure/postgres/scheduleactionrecord.go @@ -31,7 +31,7 @@ func (c *Client) AddScheduleActionRecord(ctx context.Context, scheduleActionReco // AddScheduleActionRecords adds multiple schedule action records to the database func (c *Client) AddScheduleActionRecords(ctx context.Context, scheduleActionRecords []model.ScheduleActionRecord) ([]model.ScheduleActionRecord, errors.EdgeX) { - records := make([]model.ScheduleActionRecord, len(scheduleActionRecords)) + records := make([]model.ScheduleActionRecord, 0, len(scheduleActionRecords)) for _, record := range scheduleActionRecords { r, err := c.AddScheduleActionRecord(ctx, record) if err != nil {