fix "prealloc" linting

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2026-02-12 18:05:16 +01:00
parent 775d3734eb
commit f18b8d707e
3 changed files with 4 additions and 5 deletions

View File

@@ -127,9 +127,6 @@ func checkTestRepository(t *testing.T, repository distribution.Repository, remov
configDgst := digest.FromBytes(config)
configReader := bytes.NewReader(config)
var blobDigests []digest.Digest
blobDigests = append(blobDigests, configDgst)
blobs := repository.Blobs(ctx)
// push config blob
@@ -153,6 +150,8 @@ func checkTestRepository(t *testing.T, repository distribution.Repository, remov
},
}
blobDigests := make([]digest.Digest, 0, 3)
blobDigests = append(blobDigests, configDgst)
for range 2 {
rs, dgst, err := testutil.CreateRandomTarFile()
if err != nil {

View File

@@ -1051,7 +1051,7 @@ func TestListObjectsV2(t *testing.T) {
ctx := dcontext.Background()
n := 6
prefix := "/test-list-objects-v2"
var filePaths []string
filePaths := make([]string, 0, n)
for i := range n {
filePaths = append(filePaths, fmt.Sprintf("%s/%d", prefix, i))
}

View File

@@ -21,7 +21,7 @@ func TestLinkedBlobStoreEnumerator(t *testing.T) {
fooEnv := newManifestStoreTestEnv(t, fooRepoName, "thetag")
ctx := context.Background()
var expected []string
expected := make([]string, 0, 2)
for range 2 {
rs, dgst, err := testutil.CreateRandomTarFile()
if err != nil {