mirror of
https://github.com/containers/skopeo.git
synced 2025-09-03 15:46:42 +00:00
Pre-allocate an array
golangci-lint linter: prealloc Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
@@ -668,7 +668,7 @@ func (h *proxyHandler) GetLayerInfo(args []any) (replyBuf, error) {
|
|||||||
layerInfos = img.LayerInfos()
|
layerInfos = img.LayerInfos()
|
||||||
}
|
}
|
||||||
|
|
||||||
var layers []convertedLayerInfo
|
layers := make([]convertedLayerInfo, 0, len(layerInfos))
|
||||||
for _, layer := range layerInfos {
|
for _, layer := range layerInfos {
|
||||||
layers = append(layers, convertedLayerInfo{layer.Digest, layer.Size, layer.MediaType})
|
layers = append(layers, convertedLayerInfo{layer.Digest, layer.Size, layer.MediaType})
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user