From d74c4ebf2df26f343629b0fb5889dec166f71b53 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Sat, 16 Jun 2018 15:07:40 -0700 Subject: [PATCH] Clean up some colourizing switch statements --- jenkins/widget.go | 10 +++------- jira/widget.go | 12 ++++-------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/jenkins/widget.go b/jenkins/widget.go index 32133d2e..943f78c7 100644 --- a/jenkins/widget.go +++ b/jenkins/widget.go @@ -67,16 +67,12 @@ func (widget *Widget) contentFrom(view *View) string { } func (widget *Widget) jobColor(job *Job) string { - var color string - switch job.Color { case "blue": - color = "green" + return "blue" case "red": - color = "red" + return "red" default: - color = "white" + return "white" } - - return color } diff --git a/jira/widget.go b/jira/widget.go index 62b0bb41..4ae7a4a7 100644 --- a/jira/widget.go +++ b/jira/widget.go @@ -66,20 +66,16 @@ func (widget *Widget) contentFrom(searchResult *SearchResult) string { } func (widget *Widget) issueTypeColor(issue *Issue) string { - var color string - switch issue.IssueFields.IssueType.Name { case "Bug": - color = "red" + return "red" case "Story": - color = "blue" + return "blue" case "Task": - color = "orange" + return "orange" default: - color = "white" + return "white" } - - return color } func getProjects() []string {