Problem
Two functions in pkg/cli declare parameters in their signature but immediately suppress them with _ =, meaning callers compute and pass values that are silently thrown away.
findIncludesInContent — two dead parameters
pkg/cli/remove_command.go:417-419
The function declares baseDir string and verbose bool and immediately suppresses both:
func findIncludesInContent(content, baseDir string, verbose bool) ([]string, error) {
_ = baseDir // unused parameter for now, keeping for potential future use
_ = verbose // unused parameter for now, keeping for potential future use
...
}
Callers at lines 199 and 300 compute filepath.Dir(mdFile) and pass verbose for nothing:
includes, err := findIncludesInContent(string(content), filepath.Dir(mdFile), verbose)
findPreviousSuccessfulWorkflowRuns — one dead parameter
pkg/cli/audit_comparison.go:461-462
The function silently discards its verbose bool parameter:
func findPreviousSuccessfulWorkflowRuns(ctx context.Context, current WorkflowRun, owner, repo, hostname string, verbose bool) ([]WorkflowRun, error) {
_ = verbose
...
}
Impact
- Misleading API: callers must compute and pass values that have no effect
- Maintenance hazard: future contributors expect the parameters to be meaningful
- Go idiom violation: unused parameters should not appear in a function signature
Recommendation
For findIncludesInContent: remove baseDir and verbose from the signature and update both call sites.
For findPreviousSuccessfulWorkflowRuns: remove verbose bool from the signature.
Validation
Estimated Effort: Small
Severity: Low
Generated by Sergo — Run §25358281228
Generated by Sergo - Serena Go Expert · ● 755.5K · ◷
Problem
Two functions in
pkg/clideclare parameters in their signature but immediately suppress them with_ =, meaning callers compute and pass values that are silently thrown away.findIncludesInContent— two dead parameterspkg/cli/remove_command.go:417-419The function declares
baseDir stringandverbose booland immediately suppresses both:Callers at lines 199 and 300 compute
filepath.Dir(mdFile)and passverbosefor nothing:findPreviousSuccessfulWorkflowRuns— one dead parameterpkg/cli/audit_comparison.go:461-462The function silently discards its
verbose boolparameter:Impact
Recommendation
For
findIncludesInContent: removebaseDirandverbosefrom the signature and update both call sites.For
findPreviousSuccessfulWorkflowRuns: removeverbose boolfrom the signature.Validation
go vet ./...passes cleanlyEstimated Effort: Small
Severity: Low
Generated by Sergo — Run §25358281228