From ba6af16e53cca21e1887d0d3a231f7cc8819eab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Tue, 21 Jun 2022 20:43:42 +0200 Subject: [PATCH] Use bytes.ReplaceAll instead of bytes.Replace(..., -1) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... for a trivial improvement in readability. Should not change behavior. 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 866edb73..64705b49 100644 --- a/integration/utils.go +++ b/integration/utils.go @@ -166,7 +166,7 @@ func fileFromFixture(c *check.C, inputPath string, edits map[string]string) stri contents, err := os.ReadFile(inputPath) c.Assert(err, check.IsNil) for template, value := range edits { - updated := bytes.Replace(contents, []byte(template), []byte(value), -1) + updated := bytes.ReplaceAll(contents, []byte(template), []byte(value)) c.Assert(bytes.Equal(updated, contents), check.Equals, false, check.Commentf("Replacing %s in %#v failed", template, string(contents))) // Verify that the template has matched something and we are not silently ignoring it. contents = updated }