MCPcopy
hub / github.com/apache/answer / processURL

Function processURL

pkg/checker/question_link.go:64–81  ·  view source on GitHub ↗
(content string, left, right *int, uniqueIDs map[string]struct{}, questionLinks *[]QuestionLink)

Source from the content-addressed store, hash-verified

62}
63
64func processURL(content string, left, right *int, uniqueIDs map[string]struct{}, questionLinks *[]QuestionLink) {
65 for *right < len(content) && (isDigit(content[*right]) || isLetter(content[*right])) {
66 *right++
67 }
68 questionID := content[*left+len("/questions/") : *right]
69
70 answerID := ""
71 if *right < len(content) && content[*right] == '/' {
72 *left = *right + 1
73 *right = *left
74 for *right < len(content) && (isDigit(content[*right]) || isLetter(content[*right])) {
75 *right++
76 }
77 answerID = content[*left:*right]
78 }
79
80 addUniqueID(questionID, answerID, QuestionLinkTypeURL, uniqueIDs, questionLinks)
81}
82
83func processID(content string, left, right *int, uniqueIDs map[string]struct{}, questionLinks *[]QuestionLink) {
84 for *right < len(content) && (isDigit(content[*right]) || isLetter(content[*right])) {

Callers 1

GetQuestionLinkFunction · 0.85

Calls 3

isDigitFunction · 0.85
isLetterFunction · 0.85
addUniqueIDFunction · 0.85

Tested by

no test coverage detected