From 92fd3d7f0b12a11633e6f6fcfad7fda5e16a325f Mon Sep 17 00:00:00 2001 From: mStar Date: Mon, 4 Nov 2024 16:24:11 +0100 Subject: [PATCH] Changed definition of storage.CollapseRolesIntoOne and RoleDeepCopy No more list of pointers/pointer --- cmd/RolesGenerator/main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/RolesGenerator/main.go b/cmd/RolesGenerator/main.go index ed990f4..24b7f60 100644 --- a/cmd/RolesGenerator/main.go +++ b/cmd/RolesGenerator/main.go @@ -92,9 +92,9 @@ func main() { // Build role collapse function outBuilder.WriteString( - `func CollapseRolesIntoOne(roles ...*Role) Role { - startingRole := RoleDeepCopy(&DefaultUserRole) - slices.SortFunc(roles, func(a, b *Role) int { return int(int64(a.Priority)-int64(b.Priority)) }) + `func CollapseRolesIntoOne(roles ...Role) Role { + startingRole := RoleDeepCopy(DefaultUserRole) + slices.SortFunc(roles, func(a, b Role) int { return int(int64(a.Priority)-int64(b.Priority)) }) for _, role := range roles { `) // Write all the stupid conditions here @@ -119,7 +119,7 @@ func main() { `) // Then build the deep copy function - outBuilder.WriteString("\nfunc RoleDeepCopy(o *Role) Role {\n") + outBuilder.WriteString("\nfunc RoleDeepCopy(o Role) Role {\n") outBuilder.WriteString(` n := Role{} n.Model = o.Model n.Name = o.Name