1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Clean up some colourizing switch statements

This commit is contained in:
Chris Cummer 2018-06-16 15:07:40 -07:00
parent eb5f09e65c
commit 993166e57d
2 changed files with 7 additions and 15 deletions

View File

@ -67,16 +67,12 @@ func (widget *Widget) contentFrom(view *View) string {
} }
func (widget *Widget) jobColor(job *Job) string { func (widget *Widget) jobColor(job *Job) string {
var color string
switch job.Color { switch job.Color {
case "blue": case "blue":
color = "green" return "blue"
case "red": case "red":
color = "red" return "red"
default: default:
color = "white" return "white"
} }
return color
} }

View File

@ -66,20 +66,16 @@ func (widget *Widget) contentFrom(searchResult *SearchResult) string {
} }
func (widget *Widget) issueTypeColor(issue *Issue) string { func (widget *Widget) issueTypeColor(issue *Issue) string {
var color string
switch issue.IssueFields.IssueType.Name { switch issue.IssueFields.IssueType.Name {
case "Bug": case "Bug":
color = "red" return "red"
case "Story": case "Story":
color = "blue" return "blue"
case "Task": case "Task":
color = "orange" return "orange"
default: default:
color = "white" return "white"
} }
return color
} }
func getProjects() []string { func getProjects() []string {