MCPcopy
hub / github.com/go-chi/chi / NewPattern

Function NewPattern

middleware/route_headers.go:135–139  ·  view source on GitHub ↗
(value string)

Source from the content-addressed store, hash-verified

133}
134
135func NewPattern(value string) Pattern {
136 p := Pattern{}
137 p.prefix, p.suffix, p.wildcard = strings.Cut(value, "*")
138 return p
139}
140
141func (p Pattern) Match(v string) bool {
142 if !p.wildcard {

Callers 3

TestPatternFunction · 0.85
RouteMethod · 0.85
RouteAnyMethod · 0.85

Calls

no outgoing calls

Tested by 1

TestPatternFunction · 0.68