(comments []models.Comment)
| 689 | } |
| 690 | |
| 691 | func PrintCommentTable(comments []models.Comment) { |
| 692 | if len(comments) == 0 { |
| 693 | fmt.Println("No comments.") |
| 694 | return |
| 695 | } |
| 696 | |
| 697 | for i, c := range comments { |
| 698 | badge := c.CreatedBy |
| 699 | if c.Author != "" && c.Author != c.CreatedBy { |
| 700 | badge = c.Author + " (" + c.CreatedBy + ")" |
| 701 | } |
| 702 | edited := "" |
| 703 | if c.IsEdited() { |
| 704 | edited = " • edited" |
| 705 | } |
| 706 | fmt.Printf("💬 %s • %s via %s%s • id %s\n", badge, RelativeTime(c.CreatedAt), c.Source, edited, c.ID) |
| 707 | fmt.Println(CommentBodyForDisplay(c)) |
| 708 | if i < len(comments)-1 { |
| 709 | fmt.Println() |
| 710 | } |
| 711 | } |
| 712 | } |
no test coverage detected