From adf07343cf4962ebda162a88940805684240e3e9 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Mon, 15 Dec 2025 10:45:18 -0800 Subject: [PATCH] libc/int: use strings.Builder Generated by modernize@latest (v0.21.0). Signed-off-by: Kir Kolyshkin (cherry picked from commit 652269729dea0a866d32f71f5065212b14fec2f0) Signed-off-by: Kir Kolyshkin --- libcontainer/integration/exec_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libcontainer/integration/exec_test.go b/libcontainer/integration/exec_test.go index a6bd38955..e977b36a9 100644 --- a/libcontainer/integration/exec_test.go +++ b/libcontainer/integration/exec_test.go @@ -1067,15 +1067,16 @@ func TestHook(t *testing.T) { ok(t, err) // e.g: 'ls /prestart ...' - cmd := "ls " + var cmd strings.Builder + cmd.WriteString("ls ") for _, hook := range hookFiles { - cmd += "/" + hook + " " + cmd.WriteString("/" + hook + " ") } var stdout bytes.Buffer pconfig := libcontainer.Process{ Cwd: "/", - Args: []string{"sh", "-c", cmd}, + Args: []string{"sh", "-c", cmd.String()}, Env: standardEnvironment, Stdin: nil, Stdout: &stdout,