From 108980064305fc67affd9cb45886e828aac9563a Mon Sep 17 00:00:00 2001 From: Milos Gajdos Date: Sun, 3 Sep 2023 23:26:32 +0100 Subject: [PATCH] Preallocate created slice in S3 tests In case drvr.PutContent fails and returns error we'd have some extra memory allocated, though in this case (test with known size of the slice being iterated), that's fine. Signed-off-by: Milos Gajdos --- registry/storage/driver/s3-aws/s3_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/registry/storage/driver/s3-aws/s3_test.go b/registry/storage/driver/s3-aws/s3_test.go index 8d2018042..4987c52dc 100644 --- a/registry/storage/driver/s3-aws/s3_test.go +++ b/registry/storage/driver/s3-aws/s3_test.go @@ -500,8 +500,7 @@ func TestWalk(t *testing.T) { } // create file structure matching fileset above - // nolint:prealloc - var created []string + created := make([]string, 0, len(fileset)) for _, p := range fileset { err := drvr.PutContent(context.Background(), p, []byte("content "+p)) if err != nil {