Skip to content

Commit 30b33bc

Browse files
committed
[cache] Initialize descs map
slices don't need to be initialized but maps do Signed-off-by: Baptiste Girard-Carrabin <[email protected]>
1 parent 34ade39 commit 30b33bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cache/remote.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func getAvailableBlobs(ctx context.Context, cs content.Store, chain *solver.Remo
112112
if err != nil {
113113
return nil, err
114114
}
115-
var descs map[digest.Digest]ocispecs.Descriptor
115+
var descs = map[digest.Digest]ocispecs.Descriptor{}
116116
if err := walkBlob(ctx, cs, target, func(desc ocispecs.Descriptor) bool {
117117
// Nothing prevents this function from being called multiple times for the same descriptor.
118118
// Using a map will prevent duplicates in the result.

0 commit comments

Comments
 (0)