MCPcopy Create free account
hub / github.com/cli/cli / printRawComments

Function printRawComments

pkg/cmd/discussion/view/view.go:482–493  ·  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

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

Callers 1

viewRunFunction · 0.85

Calls 2

printRawCommentFunction · 0.85
CloneMethod · 0.65

Tested by

no test coverage detected