From 1b89dd3701d6fda0f1598e49dc1571268c4a77da Mon Sep 17 00:00:00 2001 From: Tulsi Shah Date: Fri, 27 Dec 2024 10:53:52 +0000 Subject: [PATCH] undo unnecessary change --- internal/storage/fake/bucket.go | 48 ++++++++++++++++----------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/internal/storage/fake/bucket.go b/internal/storage/fake/bucket.go index 74db5e07cd..919c3bed50 100644 --- a/internal/storage/fake/bucket.go +++ b/internal/storage/fake/bucket.go @@ -232,8 +232,8 @@ func (b *bucket) checkInvariants() { // // LOCKS_REQUIRED(b.mu) func (b *bucket) mintObject( - req *gcs.CreateObjectRequest, - contents []byte) (o fakeObject) { + req *gcs.CreateObjectRequest, + contents []byte) (o fakeObject) { md5Sum := md5.Sum(contents) crc32c := crc32.Checksum(contents, crc32cTable) @@ -413,7 +413,7 @@ func createOrUpdateFakeObject(b *bucket, req *gcs.CreateObjectRequest, contents // LOCKS_REQUIRED(b.mu) func (b *bucket) createObjectLocked( - req *gcs.CreateObjectRequest) (o *gcs.Object, err error) { + req *gcs.CreateObjectRequest) (o *gcs.Object, err error) { // Check that the name is legal. err = checkName(req.Name) if err != nil { @@ -437,7 +437,7 @@ func (b *bucket) createObjectLocked( // // LOCKS_REQUIRED(b.mu) func (b *bucket) newReaderLocked( - req *gcs.ReadObjectRequest) (r io.Reader, index int, err error) { + req *gcs.ReadObjectRequest) (r io.Reader, index int, err error) { // Find the object with the requested name. index = b.objects.find(req.Name) if index == len(b.objects) { @@ -544,8 +544,8 @@ func (b *bucket) BucketType() gcs.BucketType { // LOCKS_EXCLUDED(b.mu) func (b *bucket) ListObjects( - ctx context.Context, - req *gcs.ListObjectsRequest) (listing *gcs.Listing, err error) { + ctx context.Context, + req *gcs.ListObjectsRequest) (listing *gcs.Listing, err error) { b.mu.Lock() defer b.mu.Unlock() @@ -593,7 +593,7 @@ func (b *bucket) ListObjects( // Save the result, but only if it's not a duplicate. resultPrefix := name[:resultPrefixLimit] if len(listing.CollapsedRuns) == 0 || - listing.CollapsedRuns[len(listing.CollapsedRuns)-1] != resultPrefix { + listing.CollapsedRuns[len(listing.CollapsedRuns)-1] != resultPrefix { listing.CollapsedRuns = append(listing.CollapsedRuns, resultPrefix) } @@ -660,8 +660,8 @@ func (b *bucket) ListObjects( // LOCKS_EXCLUDED(b.mu) func (b *bucket) NewReader( - ctx context.Context, - req *gcs.ReadObjectRequest) (rc io.ReadCloser, err error) { + ctx context.Context, + req *gcs.ReadObjectRequest) (rc io.ReadCloser, err error) { b.mu.Lock() defer b.mu.Unlock() @@ -676,8 +676,8 @@ func (b *bucket) NewReader( // LOCKS_EXCLUDED(b.mu) func (b *bucket) CreateObject( - ctx context.Context, - req *gcs.CreateObjectRequest) (o *gcs.Object, err error) { + ctx context.Context, + req *gcs.CreateObjectRequest) (o *gcs.Object, err error) { b.mu.Lock() defer b.mu.Unlock() @@ -707,8 +707,8 @@ func (b *bucket) FinalizeUpload(ctx context.Context, w gcs.Writer) (*gcs.MinObje // LOCKS_EXCLUDED(b.mu) func (b *bucket) CopyObject( - ctx context.Context, - req *gcs.CopyObjectRequest) (o *gcs.Object, err error) { + ctx context.Context, + req *gcs.CopyObjectRequest) (o *gcs.Object, err error) { b.mu.Lock() defer b.mu.Unlock() @@ -730,7 +730,7 @@ func (b *bucket) CopyObject( // Does it have the correct generation? if req.SrcGeneration != 0 && - b.objects[srcIndex].metadata.Generation != req.SrcGeneration { + b.objects[srcIndex].metadata.Generation != req.SrcGeneration { err = &gcs.NotFoundError{ Err: fmt.Errorf( "object %s generation %d not found", req.SrcName, req.SrcGeneration), @@ -778,8 +778,8 @@ func (b *bucket) CopyObject( // LOCKS_EXCLUDED(b.mu) func (b *bucket) ComposeObjects( - ctx context.Context, - req *gcs.ComposeObjectsRequest) (o *gcs.Object, err error) { + ctx context.Context, + req *gcs.ComposeObjectsRequest) (o *gcs.Object, err error) { b.mu.Lock() defer b.mu.Unlock() @@ -853,7 +853,7 @@ func (b *bucket) ComposeObjects( // LOCKS_EXCLUDED(b.mu) func (b *bucket) StatObject(ctx context.Context, - req *gcs.StatObjectRequest) (m *gcs.MinObject, e *gcs.ExtendedObjectAttributes, err error) { + req *gcs.StatObjectRequest) (m *gcs.MinObject, e *gcs.ExtendedObjectAttributes, err error) { // If ExtendedObjectAttributes are requested without fetching from gcs enabled, panic. if !req.ForceFetchFromGcs && req.ReturnExtendedObjectAttributes { panic("invalid StatObjectRequest: ForceFetchFromGcs: false and ReturnExtendedObjectAttributes: true") @@ -882,8 +882,8 @@ func (b *bucket) StatObject(ctx context.Context, // LOCKS_EXCLUDED(b.mu) func (b *bucket) UpdateObject( - ctx context.Context, - req *gcs.UpdateObjectRequest) (o *gcs.Object, err error) { + ctx context.Context, + req *gcs.UpdateObjectRequest) (o *gcs.Object, err error) { b.mu.Lock() defer b.mu.Unlock() @@ -913,7 +913,7 @@ func (b *bucket) UpdateObject( // Does the meta-generation precondition check out? if req.MetaGenerationPrecondition != nil && - obj.MetaGeneration != *req.MetaGenerationPrecondition { + obj.MetaGeneration != *req.MetaGenerationPrecondition { err = &gcs.PreconditionError{ Err: fmt.Errorf( "object %q has meta-generation %d", @@ -969,8 +969,8 @@ func (b *bucket) UpdateObject( // LOCKS_EXCLUDED(b.mu) func (b *bucket) DeleteObject( - ctx context.Context, - req *gcs.DeleteObjectRequest) (err error) { + ctx context.Context, + req *gcs.DeleteObjectRequest) (err error) { b.mu.Lock() defer b.mu.Unlock() @@ -982,7 +982,7 @@ func (b *bucket) DeleteObject( // Don't do anything if the generation is wrong. if req.Generation != 0 && - b.objects[index].metadata.Generation != req.Generation { + b.objects[index].metadata.Generation != req.Generation { return } @@ -1025,7 +1025,7 @@ func (b *bucket) MoveObject(ctx context.Context, req *gcs.MoveObjectRequest) (*g // Does it have the correct generation? if req.SrcGeneration != 0 && - b.objects[srcIndex].metadata.Generation != req.SrcGeneration { + b.objects[srcIndex].metadata.Generation != req.SrcGeneration { err = &gcs.NotFoundError{ Err: fmt.Errorf("object %s generation %d not found", req.SrcName, req.SrcGeneration), }