MCPcopy
hub / github.com/cli/cli / printRawComments

Function printRawComments

pkg/cmd/discussion/view/view.go:475–486  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

473// without any discussion-level fields or nested replies. Comments are
474// printed in chronological order regardless of how they were fetched.
475func 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
488func printHumanComment(opts *ViewOptions, out io.Writer, c client.DiscussionComment, indent string, isReply bool, isNewest bool) error {
489 cs := opts.IO.ColorScheme()

Callers 1

viewRunFunction · 0.85

Calls 2

printRawCommentFunction · 0.85
CloneMethod · 0.65

Tested by

no test coverage detected