formatStars formats a star count for display (e.g. 1700 > "1.7k"). TODO kw: Could be swapped for go-humanize.
(n int)
| 886 | // formatStars formats a star count for display (e.g. 1700 > "1.7k"). |
| 887 | // TODO kw: Could be swapped for go-humanize. |
| 888 | func formatStars(n int) string { |
| 889 | if n >= 1000 { |
| 890 | return fmt.Sprintf("%.1fk", float64(n)/1000) |
| 891 | } |
| 892 | return fmt.Sprintf("%d", n) |
| 893 | } |
| 894 | |
| 895 | // repoInfo holds the subset of repository metadata we fetch for ranking. |
| 896 | type repoInfo struct { |
no outgoing calls