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 66b69471d0
commit d74c4ebf2d
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 {
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
}

View File

@ -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 {