MCPcopy
hub / github.com/gin-gonic/gin / countParams

Function countParams

tree.go:80–84  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

78}
79
80func countParams(path string) uint16 {
81 colons := strings.Count(path, ":")
82 stars := strings.Count(path, "*")
83 return safeUint16(colons + stars)
84}
85
86func countSections(path string) uint16 {
87 return safeUint16(strings.Count(path, "/"))

Callers 2

addRouteMethod · 0.85
TestCountParamsFunction · 0.85

Calls 1

safeUint16Function · 0.85

Tested by 1

TestCountParamsFunction · 0.68