From 93726e7c024bb992e6a9676a415d4e500f3d3ba3 Mon Sep 17 00:00:00 2001 From: "devsy-app[bot]" <277138668+devsy-app[bot]@users.noreply.github.com> Date: Mon, 10 Aug 2026 00:16:42 +0000 Subject: [PATCH] fix: rename max var shadowing builtin Codefactor flagged the local variable 'max' in detectLanguageByExtension as a redefinition of the built-in function (pkg/language/language.go). Rename it to maxCount so the loop tracks the highest file count without shadowing the builtin max. --- pkg/language/language.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/language/language.go b/pkg/language/language.go index 58011c3845..85d6f9694d 100644 --- a/pkg/language/language.go +++ b/pkg/language/language.go @@ -218,11 +218,11 @@ func detectLanguageByExtension(root string, maxFiles int) ProgrammingLanguage { counts := countLanguageFiles(root, maxFiles) best := None - max := 0 + maxCount := 0 for lang, count := range counts { - if count > max || (count == max && lang < best) { + if count > maxCount || (count == maxCount && lang < best) { best = lang - max = count + maxCount = count } } return best