From 2a6a944c13435abf6e9d01fdcad708ee42d0b449 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Mon, 27 Feb 2023 18:01:15 +0100 Subject: [PATCH] Use io.WriteString MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... mostly so that I get practice and remember this exists in the future. (This saves one allocation & copy when the target implements io.StringWriter. And that makes absolutely no relevant difference on this path.) Signed-off-by: Miloslav Trmač --- integration/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration/utils.go b/integration/utils.go index 79ed77a3..4a7e0372 100644 --- a/integration/utils.go +++ b/integration/utils.go @@ -99,7 +99,7 @@ func runExecCmdWithInput(t *testing.T, cmd *exec.Cmd, input string) { require.NoError(t, err) err = cmd.Start() require.NoError(t, err) - _, err = stdin.Write([]byte(input)) + _, err = io.WriteString(stdin, input) require.NoError(t, err) err = stdin.Close() require.NoError(t, err)