From f220cbf99f348c539c9bfa7828902e0f19b043cc Mon Sep 17 00:00:00 2001 From: Sarah Funkhouser <147884153+golanglemonade@users.noreply.github.com> Date: Fri, 7 Feb 2025 18:53:05 -0700 Subject: [PATCH] linter Signed-off-by: Sarah Funkhouser <147884153+golanglemonade@users.noreply.github.com> --- internal/ent/hooks/onboarding.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/ent/hooks/onboarding.go b/internal/ent/hooks/onboarding.go index 4cb0b13f..e53ee033 100644 --- a/internal/ent/hooks/onboarding.go +++ b/internal/ent/hooks/onboarding.go @@ -6,10 +6,11 @@ import ( "strings" "entgo.io/ent" + "github.com/theopenlane/utils/keygen" + "github.com/theopenlane/core/internal/ent/generated" "github.com/theopenlane/core/internal/ent/generated/hook" "github.com/theopenlane/core/internal/ent/generated/organization" - "github.com/theopenlane/utils/keygen" ) // HookOnboarding runs on onboarding mutations to create the organization and settings @@ -73,6 +74,7 @@ func createOrgUniqueName(ctx context.Context, m *generated.OnboardingMutation, i if exists { input.Name = uniqueOrganizationName(input.Name) attempt += 1 + return createOrgUniqueName(ctx, m, input, attempt) } @@ -96,5 +98,5 @@ func uniqueOrganizationName(name string) string { // replace spaces with dashes name = strings.ReplaceAll(name, " ", "-") - return strings.ToLower(alphaNumericDashRegex.ReplaceAllString(name, "")) + "-" + keygen.AlphaNumeric(6) + return strings.ToLower(alphaNumericDashRegex.ReplaceAllString(name, "")) + "-" + keygen.AlphaNumeric(6) //nolint:mnd }