From f70c84ceb86a8a5bf11cf908b8dc47bd73f62ce4 Mon Sep 17 00:00:00 2001
From: Fabian Seidl <fabian.b.seidl@stud.h-da.de>
Date: Mon, 13 Jun 2022 14:25:10 +0200
Subject: [PATCH] changed ID in error to any and name to string

---
 controller/nucleus/errors/errors.go    | 6 +++---
 controller/rbac/roleFileSystemStore.go | 2 +-
 controller/rbac/userFileSystemStore.go | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/controller/nucleus/errors/errors.go b/controller/nucleus/errors/errors.go
index fd1467339..eac05eb44 100644
--- a/controller/nucleus/errors/errors.go
+++ b/controller/nucleus/errors/errors.go
@@ -182,12 +182,12 @@ func (e ErrCouldNotUpdate) Error() string {
 // ErrCouldNotFind implements the Error interface and is called if a
 // stored item can not be found.
 type ErrCouldNotFind struct {
-	ID   interface{}
-	Name interface{}
+	ID   any
+	Name string
 }
 
 func (e ErrCouldNotFind) Error() string {
-	return fmt.Sprintf("ID: %v or Name: %vnot found", e.ID, e.Name)
+	return fmt.Sprintf("ID: %v or Name: %v not found", e.ID, e.Name)
 }
 
 // ErrCouldNotCreate implements the Error interface and is called if a
diff --git a/controller/rbac/roleFileSystemStore.go b/controller/rbac/roleFileSystemStore.go
index c2bc4c71f..3c4fd0c26 100644
--- a/controller/rbac/roleFileSystemStore.go
+++ b/controller/rbac/roleFileSystemStore.go
@@ -105,7 +105,7 @@ func (s *FileSystemRoleStore) Delete(RoleToDelete rbac.Role) error {
 		}
 	}
 
-	return &errors.ErrCouldNotFind{ID: RoleToDelete.ID, Name: RoleToDelete.Name()}
+	return &errors.ErrCouldNotFind{ID: RoleToDelete.ID(), Name: RoleToDelete.Name()}
 }
 
 //Get takes a Roles ID and return the Role if found
diff --git a/controller/rbac/userFileSystemStore.go b/controller/rbac/userFileSystemStore.go
index b477a177f..f0547a6b2 100644
--- a/controller/rbac/userFileSystemStore.go
+++ b/controller/rbac/userFileSystemStore.go
@@ -105,7 +105,7 @@ func (s *FileSystemUserStore) Delete(userToDelete rbac.User) error {
 		}
 	}
 
-	return &errors.ErrCouldNotFind{ID: userToDelete.ID, Name: userToDelete.Name()}
+	return &errors.ErrCouldNotFind{ID: userToDelete.ID(), Name: userToDelete.Name()}
 }
 
 //Get takes a Users ID and return the User if found
-- 
GitLab