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)
| 473 | // without any discussion-level fields or nested replies. Comments are |
| 474 | // printed in chronological order regardless of how they were fetched. |
| 475 | func printRawComments(out io.Writer, list client.DiscussionCommentList) error { |
| 476 | comments := slices.Clone(list.Comments) |
| 477 | if list.Direction == client.DiscussionCommentListDirectionBackward { |
| 478 | slices.Reverse(comments) |
| 479 | } |
| 480 | |
| 481 | for _, c := range comments { |
| 482 | printRawComment(out, c) |
| 483 | } |
| 484 | |
| 485 | return nil |
| 486 | } |
| 487 | |
| 488 | func printHumanComment(opts *ViewOptions, out io.Writer, c client.DiscussionComment, indent string, isReply bool, isNewest bool) error { |
| 489 | cs := opts.IO.ColorScheme() |
no test coverage detected