printRawComments writes the comments as a sequence of metadata blocks, without any discussion-level fields or nested replies. Comments are printed in chronological order regardless of how they were fetched.
(out io.Writer, list client.DiscussionCommentList)
| 478 | // without any discussion-level fields or nested replies. Comments are |
| 479 | // printed in chronological order regardless of how they were fetched. |
| 480 | func printRawComments(out io.Writer, list client.DiscussionCommentList) error { |
| 481 | comments := slices.Clone(list.Comments) |
| 482 | if list.Direction == client.DiscussionCommentListDirectionBackward { |
| 483 | slices.Reverse(comments) |
| 484 | } |
| 485 | |
| 486 | for _, c := range comments { |
| 487 | printRawComment(out, c) |
| 488 | } |
| 489 | |
| 490 | return nil |
| 491 | } |
| 492 | |
| 493 | func printHumanComment(opts *ViewOptions, out io.Writer, c client.DiscussionComment, indent string, isReply bool, isNewest bool) error { |
| 494 | cs := opts.IO.ColorScheme() |
no test coverage detected