Refactor
Signed-off-by: Oliver Davies <oliver@oliverdavies.uk>
This commit is contained in:
parent
7b6712e05a
commit
1f59dd60e5
1 changed files with 9 additions and 9 deletions
|
@ -13,20 +13,20 @@ import (
|
|||
)
|
||||
|
||||
type ZetList struct {
|
||||
Ids []int
|
||||
UseColors bool
|
||||
Ids []int
|
||||
UseColours bool
|
||||
}
|
||||
|
||||
func NewZetList(ids []int, useColors ...bool) *ZetList {
|
||||
colorSetting := true
|
||||
func NewZetList(ids []int, useColours ...bool) *ZetList {
|
||||
colourSetting := true
|
||||
|
||||
if len(useColors) > 0 {
|
||||
colorSetting = useColors[0]
|
||||
if len(useColours) > 0 {
|
||||
colourSetting = useColours[0]
|
||||
}
|
||||
|
||||
return &ZetList{
|
||||
Ids: ids,
|
||||
UseColors: colorSetting,
|
||||
Ids: ids,
|
||||
UseColours: colourSetting,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ func (z *ZetList) Parse() []string {
|
|||
for _, num := range z.Ids {
|
||||
line := fmt.Sprintf("%s %s", strconv.Itoa(num), getTitle(num))
|
||||
|
||||
if z.UseColors {
|
||||
if z.UseColours {
|
||||
line = fmt.Sprintf("%s%s%s %s", green, strconv.Itoa(num), reset, getTitle(num))
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue