diff options
Diffstat (limited to 'internal/showcase/rank_history.go')
| -rw-r--r-- | internal/showcase/rank_history.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/internal/showcase/rank_history.go b/internal/showcase/rank_history.go index 92c0c33..434332f 100644 --- a/internal/showcase/rank_history.go +++ b/internal/showcase/rank_history.go @@ -178,11 +178,11 @@ func formatRankHistoryForHeader(history []RepoRankHistory) string { tokens := make([]string, 0, len(history)) for i, point := range history { - spot := fmt.Sprintf("#%d", point.Spot) if point.Spot <= 0 { - spot = "n/a" + continue } + spot := fmt.Sprintf("#%d", point.Spot) if i == 0 { tokens = append(tokens, fmt.Sprintf("%s(%s)", spot, point.Anchor)) continue @@ -190,6 +190,10 @@ func formatRankHistoryForHeader(history []RepoRankHistory) string { tokens = append(tokens, fmt.Sprintf("%s%s(%s)", point.Arrow, spot, point.Anchor)) } + if len(tokens) == 0 { + return "" + } + return " [" + strings.Join(tokens, " ") + "]" } |
