From 8b38a040830109f19550e7329b82ec5caf76b321 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Wed, 26 Oct 2022 15:23:04 +0200 Subject: Fix linting errors --- bulk.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'bulk.go') diff --git a/bulk.go b/bulk.go index 3aa40db..1c4dd4a 100644 --- a/bulk.go +++ b/bulk.go @@ -142,7 +142,7 @@ func makeBulkObjectError(fullName string, statusCode int) BulkObjectError { // The objects may be located in multiple containers, but they and the // containers must all be located in the given account. (Otherwise, // ErrAccountMismatch is returned.) -func (a *Account) BulkDelete(objects []*Object, containers []*Container, opts *RequestOptions) (numDeleted int, numNotFound int, deleteError error) { +func (a *Account) BulkDelete(objects []*Object, containers []*Container, opts *RequestOptions) (numDeleted, numNotFound int, deleteError error) { //validate that all given objects are in this account for _, obj := range objects { if !a.IsEqualTo(obj.Container().Account()) { @@ -202,12 +202,8 @@ func (a *Account) BulkDelete(objects []*Object, containers []*Container, opts *R // Implementation of BulkDelete() for servers that *do not* support bulk // deletion. -func (a *Account) bulkDeleteSingle(objects []*Object, containers []*Container, opts *RequestOptions) (int, int, error) { - var ( - numDeleted = 0 - numNotFound = 0 - errs []BulkObjectError - ) +func (a *Account) bulkDeleteSingle(objects []*Object, containers []*Container, opts *RequestOptions) (numDeleted, numNotFound int, err error) { + var errs []BulkObjectError handleSingleError := func(containerName, objectName string, err error) error { if err == nil { @@ -259,7 +255,7 @@ func (a *Account) bulkDeleteSingle(objects []*Object, containers []*Container, o // Implementation of BulkDelete() for servers that *do* support bulk deletion. // This function is called *after* chunking, so `len(names) <= // account.Capabilities.BulkDelete.MaximumDeletesPerRequest`. -func (a *Account) bulkDelete(names []string, opts *RequestOptions) (int, int, error) { +func (a *Account) bulkDelete(names []string, opts *RequestOptions) (numDeleted, numNotFound int, err error) { req := Request{ Method: "DELETE", Body: strings.NewReader(strings.Join(names, "\n") + "\n"), -- cgit v1.2.3