MCPcopy
hub / github.com/google/gvisor / parseIssueNo

Function parseIssueNo

tools/github/reviver/github.go:137–155  ·  view source on GitHub ↗

parseIssueNo parses the issue number out of the issue url. 0 is returned if url does not correspond to an issue.

(url string)

Source from the content-addressed store, hash-verified

135//
136// 0 is returned if url does not correspond to an issue.
137func parseIssueNo(url string) (int, error) {
138 // First check if I can handle the TODO.
139 var idStr string
140 for _, p := range issuePrefixes {
141 if str := strings.TrimPrefix(url, p); len(str) < len(url) {
142 idStr = str
143 break
144 }
145 }
146 if len(idStr) == 0 {
147 return 0, nil
148 }
149
150 id, err := strconv.ParseInt(strings.TrimRight(idStr, "/"), 10, 64)
151 if err != nil {
152 return 0, err
153 }
154 return int(id), nil
155}
156
157func processAllPages(fn func(github.ListOptions) (*github.Response, error)) error {
158 opts := github.ListOptions{PerPage: 1000}

Callers 2

ActivateMethod · 0.85
TestParseIssueNoFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestParseIssueNoFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…