From 48cd6e7bd98dcb851ded730a85142c553cc32c95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=80b=C3=A9j=C3=ADd=C3=A9=20=C3=80yod=C3=A9l=C3=A9?= Date: Fri, 22 May 2026 14:35:26 +0000 Subject: [PATCH] fix(lint): move test-only glob cache helpers to _test.go staticcheck reported globCacheLen and resetGlobCache as unused (U1000) because they only exist for tests. Move them to a _test.go file so they're excluded from production analysis. Co-Authored-By: Claude Opus 4.6 --- internal/approval/glob_test_helpers_test.go | 16 ++++++++++++++++ internal/approval/manager.go | 15 --------------- 2 files changed, 16 insertions(+), 15 deletions(-) create mode 100644 internal/approval/glob_test_helpers_test.go diff --git a/internal/approval/glob_test_helpers_test.go b/internal/approval/glob_test_helpers_test.go new file mode 100644 index 0000000..8d445ee --- /dev/null +++ b/internal/approval/glob_test_helpers_test.go @@ -0,0 +1,16 @@ +package approval + +import "regexp" + +func globCacheLen() int { + globCache.RLock() + n := len(globCache.m) + globCache.RUnlock() + return n +} + +func resetGlobCache() { + globCache.Lock() + globCache.m = make(map[string]*regexp.Regexp) + globCache.Unlock() +} diff --git a/internal/approval/manager.go b/internal/approval/manager.go index 7ef5b26..2991471 100644 --- a/internal/approval/manager.go +++ b/internal/approval/manager.go @@ -499,21 +499,6 @@ func globToRegexp(pattern string) (*regexp.Regexp, error) { return re, nil } -// globCacheLen returns the current number of entries in the glob regexp cache. -// Exported for testing only. -func globCacheLen() int { - globCache.RLock() - n := len(globCache.m) - globCache.RUnlock() - return n -} - -// resetGlobCache clears the glob regexp cache. Exported for testing only. -func resetGlobCache() { - globCache.Lock() - globCache.m = make(map[string]*regexp.Regexp) - globCache.Unlock() -} // judgeResultToLLMResponse converts a JudgeResult to a types.LLMResponse. func judgeResultToLLMResponse(r judge.JudgeResult, err error) *types.LLMResponse {