Skip to content

Commit

Permalink
Appease lint: else with nested if replaced with else-if
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott committed Mar 25, 2020
1 parent cbea028 commit f7b7a14
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions pkg/reconciler/pipelinerun/pipelinerun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -942,11 +942,8 @@ func TestReconcileWithTimeout(t *testing.T) {
actual := clients.Pipeline.Actions()[0].(ktesting.CreateAction).GetObject().(*v1alpha1.TaskRun)
if actual == nil {
t.Errorf("Expected a TaskRun to be created, but it wasn't.")
} else {
// The TaskRun timeout should be less than or equal to the PipelineRun timeout.
if actual.Spec.Timeout.Duration > prs[0].Spec.Timeout.Duration {
t.Errorf("TaskRun timeout %s should be less than or equal to PipelineRun timeout %s", actual.Spec.Timeout.Duration.String(), prs[0].Spec.Timeout.Duration.String())
}
} else if actual.Spec.Timeout.Duration > prs[0].Spec.Timeout.Duration {
t.Errorf("TaskRun timeout %s should be less than or equal to PipelineRun timeout %s", actual.Spec.Timeout.Duration.String(), prs[0].Spec.Timeout.Duration.String())
}
}

Expand Down

0 comments on commit f7b7a14

Please sign in to comment.