Skip to content

chore: remove dead parameters from findIncludesInContent and findPreviousSuccessfulWorkflowRuns #30274

@github-actions

Description

@github-actions

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

  • Existing tests continue to pass
  • go vet ./... passes cleanly
  • No remaining callers pass unused args

Estimated Effort: Small
Severity: Low


Generated by Sergo — Run §25358281228

Generated by Sergo - Serena Go Expert · ● 755.5K ·

  • expires on May 12, 2026, 4:59 AM UTC

Metadata

Metadata

Labels

cookieIssue Monster Loves Cookies!sergo

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions