From 21ca681d62ee242423eec9e6a41d85792fd1a6ef Mon Sep 17 00:00:00 2001 From: Martin Angers Date: Tue, 4 Jun 2024 11:56:31 -0400 Subject: [PATCH 1/2] Fix linter issue --- server/datastore/mysql/microsoft_mdm.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/datastore/mysql/microsoft_mdm.go b/server/datastore/mysql/microsoft_mdm.go index 15c2b1c1421a..f8035b1bd2ec 100644 --- a/server/datastore/mysql/microsoft_mdm.go +++ b/server/datastore/mysql/microsoft_mdm.go @@ -416,7 +416,7 @@ func updateMDMWindowsHostProfileStatusFromResponseDB( WHERE host_uuid = ? AND command_uuid IN (?)` // grab command UUIDs to find matching entries using `getMatchingHostProfilesStmt` - commandUUIDs := make([]string, len(payloads)) + commandUUIDs := make([]string, 0, len(payloads)) // also grab the payloads keyed by the command uuid, so we can easily // grab the corresponding `Detail` and `Status` from the matching // command later on. From 4b3f325581b3ac60bd058ebef036ee5f09a75c3e Mon Sep 17 00:00:00 2001 From: Martin Angers Date: Tue, 4 Jun 2024 11:57:51 -0400 Subject: [PATCH 2/2] Add changes file --- changes/19290-fix-make-slice-with-capacity | 1 + 1 file changed, 1 insertion(+) create mode 100644 changes/19290-fix-make-slice-with-capacity diff --git a/changes/19290-fix-make-slice-with-capacity b/changes/19290-fix-make-slice-with-capacity new file mode 100644 index 000000000000..27770b1bfe42 --- /dev/null +++ b/changes/19290-fix-make-slice-with-capacity @@ -0,0 +1 @@ +* Fixed a code linter issue where a slice was created non-empty and appended-to, instead of empty with the required capacity.