analyseConstantPart find the end of the constant part and create the route segment
(pattern string, nextParamPosition int)
| 345 | |
| 346 | // analyseConstantPart find the end of the constant part and create the route segment |
| 347 | func (*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 |
| 362 | func (parser *routeParser) analyseParameterPart(pattern string, regexHandler any, customConstraints ...CustomConstraint) (int, *routeSegment) { |
no test coverage detected