From dceb305ac7155e0ca445456a306adcd389f29f95 Mon Sep 17 00:00:00 2001 From: Kharec Date: Mon, 17 Nov 2025 15:37:03 +0100 Subject: [PATCH] feat: modernize statement using max() --- internal/e2e/common.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/internal/e2e/common.go b/internal/e2e/common.go index b3a602b..923e2a1 100644 --- a/internal/e2e/common.go +++ b/internal/e2e/common.go @@ -203,10 +203,7 @@ func uniqueUsername(t *testing.T, prefix string) string { fullPrefix := fmt.Sprintf("%s_%s", filePrefix, prefix) username := fmt.Sprintf("%s_%s", fullPrefix, uniqueTestID(t)) if len(username) > 50 { - maxIDLength := 50 - len(fullPrefix) - 1 - if maxIDLength < 0 { - maxIDLength = 0 - } + maxIDLength := max(50-len(fullPrefix)-1, 0) testID := uniqueTestID(t) if len(testID) > maxIDLength { testID = testID[:maxIDLength]