modernize: Use fmt.Appendf

Added in Go 1.19

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
Paweł Gronowski
2025-12-15 18:25:00 +01:00
parent cdce8f4f92
commit 39c19d9161
6 changed files with 14 additions and 14 deletions

View File

@@ -5645,7 +5645,7 @@ func (s *DockerCLIBuildSuite) TestBuildMultiStageCopyFromSyntax(c *testing.T) {
assert.Equal(c, strings.Count(result.Combined(), "Using cache"), 7)
assert.Equal(c, getIDByName(c, "build1"), getIDByName(c, "build2"))
err := os.WriteFile(filepath.Join(ctx.Dir, "Dockerfile"), []byte(fmt.Sprintf(dockerfile, "COPY baz/aa foo")), 0o644)
err := os.WriteFile(filepath.Join(ctx.Dir, "Dockerfile"), fmt.Appendf(nil, dockerfile, "COPY baz/aa foo"), 0o644)
assert.NilError(c, err)
// changing file in parent block should not affect last block