MCPcopy
hub / github.com/cli/cli / resolveCommentNodeID

Function resolveCommentNodeID

pkg/cmd/discussion/view/view.go:219–224  ·  view source on GitHub ↗

resolveCommentNodeID returns the comment node ID for the current invocation, resolving it from a comment database ID (parsed from a comment URL) when the node ID is not already known.

(c client.DiscussionClient, repo ghrepo.Interface, opts *ViewOptions)

Source from the content-addressed store, hash-verified

217// resolving it from a comment database ID (parsed from a comment URL) when the
218// node ID is not already known.
219func resolveCommentNodeID(c client.DiscussionClient, repo ghrepo.Interface, opts *ViewOptions) (string, error) {
220 if opts.CommentNodeID != "" {
221 return opts.CommentNodeID, nil
222 }
223 return c.ResolveCommentNodeID(repo, opts.CommentDatabaseID)
224}
225
226// needsComments returns true when the command should fetch full comment data,
227// either because --comments was set or because --json requested the comments field.

Callers 1

viewRunFunction · 0.85

Calls 1

ResolveCommentNodeIDMethod · 0.65

Tested by

no test coverage detected