From ce27fdb259321284dbd50ac50ca9d7dd50b635bd Mon Sep 17 00:00:00 2001 From: alingse Date: Sun, 26 May 2024 23:47:31 +0800 Subject: [PATCH] fix: fix miss makezero bug Signed-off-by: alingse --- engine/api/migrate/migrate_organization.go | 2 +- engine/hooks/trigger_workflow.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/api/migrate/migrate_organization.go b/engine/api/migrate/migrate_organization.go index f7bebb2675..713c447b82 100644 --- a/engine/api/migrate/migrate_organization.go +++ b/engine/api/migrate/migrate_organization.go @@ -33,7 +33,7 @@ func GetOrganizationUsersToMigrate(ctx context.Context, db *gorp.DbMap) ([]UserO return nil, err } - userIds := make([]string, len(allUsers)) + userIds := make([]string, 0, len(allUsers)) mapUsers := make(map[string]*sdk.AuthentifiedUser) for i := range allUsers { u := &allUsers[i] diff --git a/engine/hooks/trigger_workflow.go b/engine/hooks/trigger_workflow.go index 7d3d94e3f5..e704217b1a 100644 --- a/engine/hooks/trigger_workflow.go +++ b/engine/hooks/trigger_workflow.go @@ -84,7 +84,7 @@ func (s *Service) triggerWorkflows(ctx context.Context, hre *sdk.HookRepositoryE wh.Status = sdk.HookEventWorkflowStatusSkipped } else { // Query params to select the right workflow version to run - mods := make([]cdsclient.RequestModifier, 2) + mods := make([]cdsclient.RequestModifier, 0, 2) mods = append(mods, cdsclient.WithQueryParameter("ref", wh.Ref), cdsclient.WithQueryParameter("commit", wh.Commit)) runRequest := sdk.V2WorkflowRunHookRequest{