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

Method ListCheckRunsForRefIter

github/github-iterators.go:1762–1794  ·  view source on GitHub ↗

ListCheckRunsForRefIter returns an iterator that paginates through all results of ListCheckRunsForRef.

(ctx context.Context, owner string, repo string, ref string, opts *ListCheckRunsOptions)

Source from the content-addressed store, hash-verified

1760
1761// ListCheckRunsForRefIter returns an iterator that paginates through all results of ListCheckRunsForRef.
1762func (s *ChecksService) ListCheckRunsForRefIter(ctx context.Context, owner string, repo string, ref string, opts *ListCheckRunsOptions) iter.Seq2[*CheckRun, error] {
1763 return func(yield func(*CheckRun, error) bool) {
1764 // Create a copy of opts to avoid mutating the caller's struct
1765 if opts == nil {
1766 opts = &ListCheckRunsOptions{}
1767 } else {
1768 opts = Ptr(*opts)
1769 }
1770
1771 for {
1772 results, resp, err := s.ListCheckRunsForRef(ctx, owner, repo, ref, opts)
1773 if err != nil {
1774 yield(nil, err)
1775 return
1776 }
1777
1778 var iterItems []*CheckRun
1779 if results != nil {
1780 iterItems = results.CheckRuns
1781 }
1782 for _, item := range iterItems {
1783 if !yield(item, nil) {
1784 return
1785 }
1786 }
1787
1788 if resp.NextPage == 0 {
1789 break
1790 }
1791 opts.ListOptions.Page = resp.NextPage
1792 }
1793 }
1794}
1795
1796// ListCheckSuitesForRefIter returns an iterator that paginates through all results of ListCheckSuitesForRef.
1797func (s *ChecksService) ListCheckSuitesForRefIter(ctx context.Context, owner string, repo string, ref string, opts *ListCheckSuiteOptions) iter.Seq2[*CheckSuite, error] {

Calls 2

ListCheckRunsForRefMethod · 0.95
PtrFunction · 0.70