MCPcopy Index your code
hub / github.com/nikivdev/go / parseNumericCandidate

Function parseNumericCandidate

main.go:1297–1314  ·  view source on GitHub ↗
(raw string)

Source from the content-addressed store, hash-verified

1295}
1296
1297func parseNumericCandidate(raw string) (int, bool) {
1298 trimmed := strings.TrimSpace(raw)
1299 if trimmed == "" {
1300 return 0, false
1301 }
1302 if idx := strings.IndexAny(trimmed, "?#"); idx >= 0 {
1303 trimmed = trimmed[:idx]
1304 }
1305 trimmed = strings.TrimSpace(trimmed)
1306 if trimmed == "" {
1307 return 0, false
1308 }
1309 number, err := strconv.Atoi(trimmed)
1310 if err != nil || number <= 0 {
1311 return 0, false
1312 }
1313 return number, true
1314}
1315
1316func mdToHTML(md []byte) []byte {
1317 extensions := parser.CommonExtensions | parser.AutoHeadingIDs | parser.NoEmptyLineBeforeBlock

Callers 3

guessPullRequestDetailsFunction · 0.85
promptPullRequestNumberFunction · 0.85
extractPullRequestNumberFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected