From 92b1f768b4e035e57ec3fd4944ab20dbddf1c334 Mon Sep 17 00:00:00 2001 From: Ralf Haferkamp Date: Wed, 28 Feb 2024 16:22:06 +0100 Subject: [PATCH] fix: Remove unneeded code errors.Join(errs...) ignores nil errors and returns nil if there are not errors. (cherry picked from commit f5a282c13e4245fb29e7e7217889878a4efb99ce) --- services/graph/pkg/service/v0/api_drives_drive_item.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/services/graph/pkg/service/v0/api_drives_drive_item.go b/services/graph/pkg/service/v0/api_drives_drive_item.go index 255e3b9990..dd1253622a 100644 --- a/services/graph/pkg/service/v0/api_drives_drive_item.go +++ b/services/graph/pkg/service/v0/api_drives_drive_item.go @@ -118,13 +118,7 @@ func (s DrivesDriveItemService) UnmountShare(ctx context.Context, resourceID sto } } - // We call it a success if all shares could successfully be rejected, otherwise - // we return an error - if len(errs) != 0 { - return errors.Join(errs...) - } - - return nil + return errors.Join(errs...) } // MountShare mounts a share