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

Function findNextPage

pkg/cmd/api/pagination.go:17–24  ·  view source on GitHub ↗
(resp *http.Response)

Source from the content-addressed store, hash-verified

15var linkRE = regexp.MustCompile(`<([^>]+)>;\s*rel="([^"]+)"`)
16
17func findNextPage(resp *http.Response) (string, bool) {
18 for _, m := range linkRE.FindAllStringSubmatch(resp.Header.Get("Link"), -1) {
19 if len(m) > 2 && m[2] == "next" {
20 return m[1], true
21 }
22 }
23 return "", false
24}
25
26func findEndCursor(r io.Reader) string {
27 dec := json.NewDecoder(r)

Callers 2

apiRunFunction · 0.70
Test_findNextPageFunction · 0.70

Calls 1

GetMethod · 0.65

Tested by 1

Test_findNextPageFunction · 0.56