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

Method ListIssueEventsIter

github/github-iterators.go:3572–3600  ·  view source on GitHub ↗

ListIssueEventsIter returns an iterator that paginates through all results of ListIssueEvents.

(ctx context.Context, owner string, repo string, number int, opts *ListOptions)

Source from the content-addressed store, hash-verified

3570
3571// ListIssueEventsIter returns an iterator that paginates through all results of ListIssueEvents.
3572func (s *IssuesService) ListIssueEventsIter(ctx context.Context, owner string, repo string, number int, opts *ListOptions) iter.Seq2[*IssueEvent, error] {
3573 return func(yield func(*IssueEvent, error) bool) {
3574 // Create a copy of opts to avoid mutating the caller's struct
3575 if opts == nil {
3576 opts = &ListOptions{}
3577 } else {
3578 opts = Ptr(*opts)
3579 }
3580
3581 for {
3582 results, resp, err := s.ListIssueEvents(ctx, owner, repo, number, opts)
3583 if err != nil {
3584 yield(nil, err)
3585 return
3586 }
3587
3588 for _, item := range results {
3589 if !yield(item, nil) {
3590 return
3591 }
3592 }
3593
3594 if resp.NextPage == 0 {
3595 break
3596 }
3597 opts.Page = resp.NextPage
3598 }
3599 }
3600}
3601
3602// ListIssueTimelineIter returns an iterator that paginates through all results of ListIssueTimeline.
3603func (s *IssuesService) ListIssueTimelineIter(ctx context.Context, owner string, repo string, number int, opts *ListOptions) iter.Seq2[*Timeline, error] {

Callers 1

Calls 2

ListIssueEventsMethod · 0.95
PtrFunction · 0.70

Tested by 1