From 38f6bf07cce8c3c6b9fa29e294ce06fcb1b026bb Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Thu, 15 Jan 2026 16:41:17 -0800 Subject: [PATCH] pkg/emulation: remove slice copying Copying the slice is not necessary here since registeredBinfmtMisc always creates the slice from scratch. This commit is part of series fixing issues reported by prealloc linter from golangci-lint v2.8.0. Signed-off-by: Kir Kolyshkin --- pkg/emulation/emulation.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/emulation/emulation.go b/pkg/emulation/emulation.go index 49b32c1f5c..87ad7e7929 100644 --- a/pkg/emulation/emulation.go +++ b/pkg/emulation/emulation.go @@ -7,12 +7,10 @@ import "github.com/sirupsen/logrus" // Registered returns a list of platforms for which we think we have user // space emulation available. func Registered() []string { - var registered []string - binfmt, err := registeredBinfmtMisc() + registered, err := registeredBinfmtMisc() if err != nil { logrus.Warnf("registeredBinfmtMisc(): %v", err) return nil } - registered = append(registered, binfmt...) return registered }