Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a gocritic lint issue: use switch instead of ifelse 🏑 #1634

Merged
merged 1 commit into from
Nov 27, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down