replaceWildcards takes a route pattern and replaces all occurrences of "/*/" with "/". It iteratively runs until no wildcards remain to correctly handle consecutive wildcards.
(p string)
| 137 | // "/*/" with "/". It iteratively runs until no wildcards remain to |
| 138 | // correctly handle consecutive wildcards. |
| 139 | func replaceWildcards(p string) string { |
| 140 | for strings.Contains(p, "/*/") { |
| 141 | p = strings.ReplaceAll(p, "/*/", "/") |
| 142 | } |
| 143 | return p |
| 144 | } |
| 145 | |
| 146 | // RouteParams is a structure to track URL routing parameters efficiently. |
| 147 | type RouteParams struct { |
no outgoing calls