formatStars formats a star count for display, like gh skill search: 0 → "" 65 → "★ 65" 1500 → "★ 1.5k" 40800 → "★ 40.8k"
(n int)
| 300 | // 1500 → "★ 1.5k" |
| 301 | // 40800 → "★ 40.8k" |
| 302 | func formatStars(n int) string { |
| 303 | if n <= 0 { |
| 304 | return "" |
| 305 | } |
| 306 | if n < 1000 { |
| 307 | return fmt.Sprintf("★ %d", n) |
| 308 | } |
| 309 | k := float64(n) / 1000.0 |
| 310 | if k >= 10 { |
| 311 | return fmt.Sprintf("★ %.1fk", k) |
| 312 | } |
| 313 | return fmt.Sprintf("★ %.1fk", k) |
| 314 | } |
| 315 | |
| 316 | // searchGitHub queries the GitHub Code Search API for manifest files matching |
| 317 | // the query, using parallel search strategies mirroring gh skill search: |
no outgoing calls
no test coverage detected