Skip to content

Commit 93f1933

Browse files
vdemeestertekton-robot
authored andcommitted
Fix a gocritic lint issue: use switch instead of ifelse 🏑
Signed-off-by: Vincent Demeester <[email protected]>
1 parent 6f6d7bf commit 93f1933

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎pkg/reconciler/pipelinerun/resources/pipelinerunresolution_test.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -1511,11 +1511,12 @@ func TestResolveConditionChecks_MultipleConditions(t *testing.T) {
15111511
{
15121512
name: "conditionCheck exists",
15131513
getTaskRun: func(name string) (*v1alpha1.TaskRun, error) {
1514-
if name == "pipelinerun-mytask1-9l9zj-always-true-mz4c7" {
1514+
switch name {
1515+
case "pipelinerun-mytask1-9l9zj-always-true-mz4c7":
15151516
return cc1, nil
1516-
} else if name == "pipelinerun-mytask1-9l9zj" {
1517+
case "pipelinerun-mytask1-9l9zj":
15171518
return &trs[0], nil
1518-
} else if name == "pipelinerun-mytask1-9l9zj-always-true-mssqb" {
1519+
case "pipelinerun-mytask1-9l9zj-always-true-mssqb":
15191520
return cc2, nil
15201521
}
15211522
return nil, xerrors.Errorf("getTaskRun called with unexpected name %s", name)

0 commit comments

Comments
 (0)