From e58b7045c8eb0b4a755a7cd8aed61fddd7da4bc0 Mon Sep 17 00:00:00 2001 From: Vincent Demeester Date: Wed, 27 Nov 2019 15:23:44 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20a=20gocritic=20lint=20issue:=20use=20swit?= =?UTF-8?q?ch=20instead=20of=20ifelse=20=F0=9F=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Vincent Demeester --- .../pipelinerun/resources/pipelinerunresolution_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/reconciler/pipelinerun/resources/pipelinerunresolution_test.go b/pkg/reconciler/pipelinerun/resources/pipelinerunresolution_test.go index 28f1ce8eeee..959022a8d8b 100644 --- a/pkg/reconciler/pipelinerun/resources/pipelinerunresolution_test.go +++ b/pkg/reconciler/pipelinerun/resources/pipelinerunresolution_test.go @@ -1511,11 +1511,12 @@ func TestResolveConditionChecks_MultipleConditions(t *testing.T) { { name: "conditionCheck exists", getTaskRun: func(name string) (*v1alpha1.TaskRun, error) { - if name == "pipelinerun-mytask1-9l9zj-always-true-mz4c7" { + switch name { + case "pipelinerun-mytask1-9l9zj-always-true-mz4c7": return cc1, nil - } else if name == "pipelinerun-mytask1-9l9zj" { + case "pipelinerun-mytask1-9l9zj": return &trs[0], nil - } else if name == "pipelinerun-mytask1-9l9zj-always-true-mssqb" { + case "pipelinerun-mytask1-9l9zj-always-true-mssqb": return cc2, nil } return nil, xerrors.Errorf("getTaskRun called with unexpected name %s", name)