Skip to content

fix(lint): move test-only glob cache helpers to _test.go#33

Merged
bjhaid merged 1 commit into
mainfrom
fix/unused-glob-cache-helpers
May 22, 2026
Merged

fix(lint): move test-only glob cache helpers to _test.go#33
bjhaid merged 1 commit into
mainfrom
fix/unused-glob-cache-helpers

Conversation

@bjhaid
Copy link
Copy Markdown
Contributor

@bjhaid bjhaid commented May 22, 2026

Summary

  • Moves globCacheLen and resetGlobCache from manager.go to a new glob_test_helpers_test.go file
  • Fixes staticcheck U1000 (unused function) lint errors — these functions are only called from tests
  • No behavioral change; tests continue to pass

Test plan

  • go build ./internal/approval/ passes
  • go vet ./internal/approval/ passes
  • go test ./internal/approval/ passes
  • staticcheck ./internal/approval/ no longer reports U1000

🤖 Generated with Claude Code

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 <noreply@anthropic.com>
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 22, 2026

Greptile Summary

Moves two test-only helper functions (globCacheLen and resetGlobCache) from manager.go to a new glob_test_helpers_test.go file, fixing staticcheck U1000 (unused function) lint errors. No behavioral changes — functions remain in the same package and retain access to unexported globCache internals via Go's same-package test file convention.

Confidence Score: 5/5

This PR is safe to merge — it's a straightforward lint fix with no behavioral changes.

Minimal, mechanical change that moves two test-only functions to a _test.go file. The functions are only used in tests, the package access is preserved, and no logic was modified.

No files require special attention.

Important Files Changed

Filename Overview
internal/approval/glob_test_helpers_test.go New file containing globCacheLen and resetGlobCache helpers moved from manager.go. Correctly placed in _test.go to fix staticcheck U1000 lint. Functions properly access unexported globCache fields via same-package test file.
internal/approval/manager.go Removed two test-only helper functions (globCacheLen, resetGlobCache). Leaves a minor extra blank line but no functional issues.

Reviews (2): Last reviewed commit: "fix(lint): move test-only glob cache hel..." | Re-trigger Greptile

@bjhaid bjhaid marked this pull request as ready for review May 22, 2026 14:38
@bjhaid bjhaid merged commit d0d1f29 into main May 22, 2026
7 checks passed
@bjhaid bjhaid deleted the fix/unused-glob-cache-helpers branch May 22, 2026 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant