From 652269729dea0a866d32f71f5065212b14fec2f0 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 --- 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 5cbcd2da4..9133b6801 100644 --- a/libcontainer/integration/exec_test.go +++ b/libcontainer/integration/exec_test.go @@ -1068,15 +1068,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,