refactor: remove dead code in utils#335
Conversation
There was a problem hiding this comment.
⚠️ Not ready to approve
The new NextBackOff implementation can overflow time.Duration on doubling before applying the cap, which can produce negative intervals for very large MaxInterval configurations.
Pull request overview
This PR removes unused utility helpers from pkg/utils and simplifies the retry backoff calculation in internal/retry by switching from math.Min to the Go built-in min, reducing imports and avoiding float conversions.
Changes:
- Removed dead code from
pkg/utils/utils.go(JoinUint64sand glob-expansion helpers). - Simplified
ExponentialBackoff.NextBackOffininternal/retry/retry.goto usemin()and drop themathimport.
File summaries
| File | Description |
|---|---|
| pkg/utils/utils.go | Deletes unused helper functions and removes the now-unneeded path/filepath import. |
| internal/retry/retry.go | Simplifies backoff capping logic by using min() instead of math.Min. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 1
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
b94a91d to
01180c6
Compare
There was a problem hiding this comment.
✅ Ready to approve
The change is limited to verified-unused code removal (no remaining in-repo call sites), with no functional behavior changes introduced.
Note: this review does not count toward required approvals for merging.
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 0 new
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
What
Remove unused functions from
pkg/utils/utils.go:JoinUint64sand theExpandGlobArgsfamily (expandSingleGlobArg,toAbsolutePattern,toRelativePaths,containsGlobPattern), plus the now-unneededpath/filepathimport.Why
The removed functions had zero callers.
ExpandGlobArgswas only ever used by the oldpkg/runner/shell.go; once shell execution moved toexecutor/handlers/shell/, the call site went away and the functions became dead code.No behavior change. Build and tests pass.