MCPcopy
hub / github.com/gofiber/fiber / preferredGreedyParameters

Function preferredGreedyParameters

router.go:167–178  ·  view source on GitHub ↗

preferredGreedyParameters returns the generic greedy fallback lookup order for a route parameter name. Parameter names starting with '+' prefer '+' before '*', names starting with '*' prefer '*' before '+', and all other names fall back to the default order.

(paramName string)

Source from the content-addressed store, hash-verified

165// Parameter names starting with '+' prefer '+' before '*', names starting with
166// '*' prefer '*' before '+', and all other names fall back to the default order.
167func preferredGreedyParameters(paramName string) []string {
168 if paramName != "" {
169 switch paramName[0] {
170 case plusParam:
171 return preferredPlusGreedyParameters
172 case wildcardParam:
173 return defaultGreedyParameterKeys
174 }
175 }
176
177 return defaultGreedyParameterKeys
178}
179
180func (r *Route) match(detectionPath, path string, params *[maxParams]string) bool {
181 // root detectionPath check

Callers 2

buildRouteURLFunction · 0.85
Test_Route_URLFunction · 0.85

Calls

no outgoing calls

Tested by 1

Test_Route_URLFunction · 0.68