MCPcopy Index your code
hub / github.com/google/go-github / ListIssueCommentReactionsIter

Method ListIssueCommentReactionsIter

github/github-iterators.go:5235–5263  ·  view source on GitHub ↗

ListIssueCommentReactionsIter returns an iterator that paginates through all results of ListIssueCommentReactions.

(ctx context.Context, owner string, repo string, id int64, opts *ListReactionOptions)

Source from the content-addressed store, hash-verified

5233
5234// ListIssueCommentReactionsIter returns an iterator that paginates through all results of ListIssueCommentReactions.
5235func (s *ReactionsService) ListIssueCommentReactionsIter(ctx context.Context, owner string, repo string, id int64, opts *ListReactionOptions) iter.Seq2[*Reaction, error] {
5236 return func(yield func(*Reaction, error) bool) {
5237 // Create a copy of opts to avoid mutating the caller's struct
5238 if opts == nil {
5239 opts = &ListReactionOptions{}
5240 } else {
5241 opts = Ptr(*opts)
5242 }
5243
5244 for {
5245 results, resp, err := s.ListIssueCommentReactions(ctx, owner, repo, id, opts)
5246 if err != nil {
5247 yield(nil, err)
5248 return
5249 }
5250
5251 for _, item := range results {
5252 if !yield(item, nil) {
5253 return
5254 }
5255 }
5256
5257 if resp.NextPage == 0 {
5258 break
5259 }
5260 opts.ListOptions.Page = resp.NextPage
5261 }
5262 }
5263}
5264
5265// ListIssueReactionsIter returns an iterator that paginates through all results of ListIssueReactions.
5266func (s *ReactionsService) ListIssueReactionsIter(ctx context.Context, owner string, repo string, number int, opts *ListReactionOptions) iter.Seq2[*Reaction, error] {

Calls 2

PtrFunction · 0.70