Skip to content
This repository was archived by the owner on Jan 30, 2026. It is now read-only.

Commit 3a05f2f

Browse files
committed
Ensure slice length preallocation is correct
Signed-off-by: Jose R. Gonzalez <komish@flutes.dev>
1 parent dd3b576 commit 3a05f2f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

internal/catalogapi/catalogapi.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ func PopulateProduct(
261261
return nil, err
262262
}
263263

264-
attachedIDs := make([]string, len(associatedComponents))
264+
attachedIDs := make([]string, 0, len(associatedComponents))
265265
newListing.With.Components = make([]*resource.Component, 0, len(associatedComponents))
266266
for _, v := range associatedComponents {
267267
attachedIDs = append(attachedIDs, v.Id)
@@ -281,7 +281,6 @@ func PopulateProduct(
281281
slices.Sort(attachedIDs)
282282
slices.Sort(newListing.Spec.CertProjects)
283283

284-
L.Info("foo")
285284
if !slices.Equal(attachedIDs, newListing.Spec.CertProjects) {
286285
L.Debug("product listing has attached components that are not marked as active.")
287286
L.Debug(

0 commit comments

Comments
 (0)