MCPcopy Index your code
hub / github.com/gofiber/fiber / analyseConstantPart

Method analyseConstantPart

path.go:347–359  ·  view source on GitHub ↗

analyseConstantPart find the end of the constant part and create the route segment

(pattern string, nextParamPosition int)

Source from the content-addressed store, hash-verified

345
346// analyseConstantPart find the end of the constant part and create the route segment
347func (*routeParser) analyseConstantPart(pattern string, nextParamPosition int) (int, *routeSegment) {
348 // handle the constant part
349 processedPart := pattern
350 if nextParamPosition != -1 {
351 // remove the constant part until the parameter
352 processedPart = pattern[:nextParamPosition]
353 }
354 constPart := RemoveEscapeChar(processedPart)
355 return len(processedPart), &routeSegment{
356 Const: constPart,
357 Length: len(constPart),
358 }
359}
360
361// analyseParameterPart find the parameter end and create the route segment
362func (parser *routeParser) analyseParameterPart(pattern string, regexHandler any, customConstraints ...CustomConstraint) (int, *routeSegment) {

Callers 1

parseRouteMethod · 0.95

Calls 1

RemoveEscapeCharFunction · 0.85

Tested by

no test coverage detected