Skip to content

remove dead playWhenSkipped variable in renderListTasks #429

Description

@josegonzalez

Description

renderListTasks declares playWhenSkipped, assigns it, and then discards it:

playWhenSkipped := false
if play.HasWhen() {
    // ...
    if !ok {
        playWhenSkipped = true
        // ... emits the skip line, then:
        continue
    }
}
_ = playWhenSkipped

Every path that sets the variable continues before it is read, so the _ = playWhenSkipped
discard at the end is the only thing keeping the compiler quiet. The declaration, the assignment,
and the discard can all go.

Noticed while working on #412, which moved the play-scoping bats tests onto plan --list-tasks.
Left out of that PR to keep it a test-only change.

Location

commands/list_tasks.go:110, :128, :142

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions