From ccbe206a8c8f0915445c7a2b17c8e048caf6a290 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 22 Jan 2026 10:26:54 +0100 Subject: [PATCH] cli/command/containerd: parseSecurityOpts: remove redundant sprintf Signed-off-by: Sebastiaan van Stijn --- cli/command/container/opts.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/command/container/opts.go b/cli/command/container/opts.go index fc93b59d4b51..b36d04968c09 100644 --- a/cli/command/container/opts.go +++ b/cli/command/container/opts.go @@ -947,11 +947,11 @@ func parseSecurityOpts(securityOpts []string) ([]string, error) { if err != nil { return securityOpts, fmt.Errorf("opening seccomp profile (%s) failed: %w", v, err) } - b := bytes.NewBuffer(nil) - if err := json.Compact(b, f); err != nil { + var b bytes.Buffer + if err := json.Compact(&b, f); err != nil { return securityOpts, fmt.Errorf("compacting json for seccomp profile (%s) failed: %w", v, err) } - securityOpts[key] = fmt.Sprintf("seccomp=%s", b.Bytes()) + securityOpts[key] = "seccomp=" + b.String() } } }