Skip to content

Remove 21 dead functions detected by deadcode analysis#71

Open
marcus wants to merge 1 commit intomainfrom
dead-code/remove-unused
Open

Remove 21 dead functions detected by deadcode analysis#71
marcus wants to merge 1 commit intomainfrom
dead-code/remove-unused

Conversation

@marcus
Copy link
Copy Markdown
Owner

@marcus marcus commented Mar 24, 2026

Summary

  • Remove 21 functions/methods confirmed unreachable (even from tests) by deadcode -test ./...
  • Covers 12 files across analysis, logging, orchestrator, scheduler, security, snapshots, tasks, and tmux packages
  • Net removal of ~410 lines of dead code with zero behavioral changes

Changes by package

Package Removed
analysis LoadLatest, LoadAll
logging Logger.With, Logger.Err, Logger.Event
orchestrator WithBudget, WithQueue + queue field cleanup
scheduler Scheduler.Schedule
security AuditLogger.RotateIfNeeded, CredentialManager.GetWarnings, CredentialManager.EnsureNoCredentialsInFile, Sandbox.ExecuteWithIO, Manager.Credentials, Manager.Audit, Manager.CheckPreExecution
snapshots Collector.GetSinceWeekStart, Collector.GetHourlyAverages
tasks Selector.ClearSimulatedCooldowns, Queue type + NewQueue/Add/Next
tmux WithWorkDir

Test plan

  • go build ./... passes
  • go test ./... passes (all packages)
  • Pre-commit hooks (gofmt, go vet, go build) pass

Nightshift-Task: dead-code
Nightshift-Ref: https://github.com/marcus/nightshift


Automated by nightshift

Remove functions/methods confirmed unreachable even from test code
by golang.org/x/tools/cmd/deadcode analysis:

- analysis: LoadLatest, LoadAll
- logging: Logger.With, Logger.Err, Logger.Event
- orchestrator: WithBudget, WithQueue (+ queue field cleanup)
- scheduler: Scheduler.Schedule
- security: AuditLogger.RotateIfNeeded, CredentialManager.GetWarnings,
  CredentialManager.EnsureNoCredentialsInFile, Sandbox.ExecuteWithIO,
  Manager.Credentials, Manager.Audit, Manager.CheckPreExecution
- snapshots: Collector.GetSinceWeekStart, Collector.GetHourlyAverages
- tasks: Selector.ClearSimulatedCooldowns, Queue type + NewQueue/Add/Next
- tmux: WithWorkDir

Nightshift-Task: dead-code
Nightshift-Ref: https://github.com/marcus/nightshift
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