MCPcopy Create free account
hub / github.com/devfeel/dotweb / countParams

Function countParams

tree.go:22–31  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

20const maxParamCount uint8 = ^uint8(0)
21
22func countParams(path string) uint8 {
23 var n uint
24 for i := range []byte(path) {
25 switch path[i] {
26 case ':', '*':
27 n++
28 }
29 }
30 return uint8(n)
31}
32
33type nodeType uint8
34

Callers 1

addRouteMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected