From 4fce3c0028eaf3282a035efb9b099b7dd8aecfaf Mon Sep 17 00:00:00 2001 From: Milos Gajdos Date: Thu, 28 Sep 2023 15:57:22 +0100 Subject: [PATCH] Move completedParts type back to the original position Signed-off-by: Milos Gajdos --- registry/storage/driver/s3-aws/s3.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/registry/storage/driver/s3-aws/s3.go b/registry/storage/driver/s3-aws/s3.go index 6e833753..bd61bccb 100644 --- a/registry/storage/driver/s3-aws/s3.go +++ b/registry/storage/driver/s3-aws/s3.go @@ -1261,12 +1261,6 @@ func (d *driver) getStorageClass() *string { return aws.String(d.StorageClass) } -type completedParts []*s3.CompletedPart - -func (a completedParts) Len() int { return len(a) } -func (a completedParts) Swap(i, j int) { a[i], a[j] = a[j], a[i] } -func (a completedParts) Less(i, j int) bool { return *a[i].PartNumber < *a[j].PartNumber } - // buffer is a static size bytes buffer. type buffer struct { data []byte @@ -1343,6 +1337,12 @@ func (d *driver) newWriter(key, uploadID string, parts []*s3.Part) storagedriver } } +type completedParts []*s3.CompletedPart + +func (a completedParts) Len() int { return len(a) } +func (a completedParts) Swap(i, j int) { a[i], a[j] = a[j], a[i] } +func (a completedParts) Less(i, j int) bool { return *a[i].PartNumber < *a[j].PartNumber } + func (w *writer) Write(p []byte) (int, error) { if w.closed { return 0, fmt.Errorf("already closed")