mirror of
https://github.com/distribution/distribution.git
synced 2026-02-21 14:22:14 +00:00
fix "prealloc" linting
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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))
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user