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:
parent
66b69471d0
commit
d74c4ebf2d
@ -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
|
||||
}
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user