listNames joins names for messages, shortening long lists.
(names []string, limit int)
| 259 | |
| 260 | // listNames joins names for messages, shortening long lists. |
| 261 | func listNames(names []string, limit int) string { |
| 262 | sorted := append([]string(nil), names...) |
| 263 | sort.Strings(sorted) |
| 264 | if len(sorted) > limit { |
| 265 | return strings.Join(sorted[:limit], ", ") + fmt.Sprintf(" and %d more", len(sorted)-limit) |
| 266 | } |
| 267 | return strings.Join(sorted, ", ") |
| 268 | } |
| 269 | |
| 270 | // dedupe drops repeated problems, keeping the first of each. |
| 271 | func dedupe(problems []string) []string { |
no test coverage detected