findWildcard() — gin Function Reference
Architecture documentation for the findWildcard() function in tree.go from the gin codebase.
Entity Profile
Dependency Diagram
graph TD 87a6c068_bb91_40a9_38a2_36113e02d2c9["findWildcard()"] c26db86d_6014_ffb1_aad9_2c5f3b61998b["tree.go"] 87a6c068_bb91_40a9_38a2_36113e02d2c9 -->|defined in| c26db86d_6014_ffb1_aad9_2c5f3b61998b style 87a6c068_bb91_40a9_38a2_36113e02d2c9 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
tree.go lines 253–286
func findWildcard(path string) (wildcard string, i int, valid bool) {
// Find start
escapeColon := false
for start, c := range []byte(path) {
if escapeColon {
escapeColon = false
if c == ':' {
continue
}
panic("invalid escape string in path '" + path + "'")
}
if c == '\\' {
escapeColon = true
continue
}
// A wildcard starts with ':' (param) or '*' (catch-all)
if c != ':' && c != '*' {
continue
}
// Find end and check for invalid characters
valid = true
for end, c := range []byte(path[start+1:]) {
switch c {
case '/':
return path[start : start+1+end], start, valid
case ':', '*':
valid = false
}
}
return path[start:], start, valid
}
return "", -1, false
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does findWildcard() do?
findWildcard() is a function in the gin codebase, defined in tree.go.
Where is findWildcard() defined?
findWildcard() is defined in tree.go at line 253.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free