From 4a689a9761c94128748d40f58f8affc387642f2c Mon Sep 17 00:00:00 2001 From: "devsy-app[bot]" <277138668+devsy-app[bot]@users.noreply.github.com> Date: Sun, 9 Aug 2026 22:05:23 +0000 Subject: [PATCH] fix: rename max param shadowing builtin Codefactor flagged pkg/encoding/encoding.go: SafeConcatNameMax redefines the built-in function max. Rename the parameter (and its uses) to maxLen, matching the existing alias in pkg/id/id.go. No behavior change. --- pkg/encoding/encoding.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/encoding/encoding.go b/pkg/encoding/encoding.go index efef27ad8d..9c594301e1 100644 --- a/pkg/encoding/encoding.go +++ b/pkg/encoding/encoding.go @@ -48,12 +48,12 @@ func IsLegacyUID(uid string) bool { return len(uid) != WorkspaceUIDLength && len(uid) != MachineUIDLength } -func SafeConcatNameMax(name []string, max int) string { +func SafeConcatNameMax(name []string, maxLen int) string { fullPath := strings.Join(name, "-") - if len(fullPath) > max { + if len(fullPath) > maxLen { digest := sha256.Sum256([]byte(fullPath)) digestEncoded := hex.EncodeToString(digest[0:]) - trimmedPath := fullPath[0 : max-6] + trimmedPath := fullPath[0 : maxLen-6] if strings.HasSuffix(trimmedPath, "-") { trimmedPath += digestEncoded[0:6] } else {