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
Description
renderListTasksdeclaresplayWhenSkipped, assigns it, and then discards it:Every path that sets the variable
continues before it is read, so the_ = playWhenSkippeddiscard 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