Skip to content

Commit

Permalink
Fix formatting of stages
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Wooding committed Sep 3, 2022
1 parent 9a22c55 commit 6e57d6f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/area.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Ref: https://documenter.getpostman.com/view/1296288/UzQuNk3E#1881472b-c959-4259-
println(0)
tbl.AddRow(day.Date, day.Name, "")
} else {
tbl.AddRow(day.Date, day.Name, stageString(stages))
tbl.AddRow(day.Date, day.Name, stageString(stages[0]))
if len(stages) > 1 {
for _, stage := range stages[1:] {
tbl.AddRow("", "", stageString(stage))
Expand All @@ -86,6 +86,8 @@ func init() {
func stageString(stage []string) string {
if len(stage) == 0 {
return ""
} else if len(stage) == 1 {
return stage[0]
} else {
return fmt.Sprintf("%s - %s", stage[0], stage[1])
}
Expand Down

0 comments on commit 6e57d6f

Please sign in to comment.