summaryrefslogtreecommitdiff
path: root/pathrouter/element.go
diff options
context:
space:
mode:
authorStefan Majewsky <majewsky@gmx.net>2026-10-02 15:02:43 +0200
committerStefan Majewsky <majewsky@gmx.net>2026-10-02 15:02:43 +0200
commit1635adc08aa413bbd7d2cf67e66ad6e9a823169a (patch)
treee85a855893ce3632d3d43e58891208653fb70cb8 /pathrouter/element.go
parent7b1cca50c21a6156824e276e2b6c662d33cc9071 (diff)
downloadgo-gg-1635adc08aa413bbd7d2cf67e66ad6e9a823169a.tar.gz
pathrouter: replace `vars` by new type Context
This is a breaking change, but there are no real users of this package yet. I want to use the opportunity to have an extensible type here, esp. to later add a cheaper alternative to context.Context.WithValue() that is baked by just `map[reflect.Type]any` instead of a stack of contexts.
Diffstat (limited to 'pathrouter/element.go')
-rw-r--r--pathrouter/element.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pathrouter/element.go b/pathrouter/element.go
index 9512924..395fb40 100644
--- a/pathrouter/element.go
+++ b/pathrouter/element.go
@@ -24,11 +24,11 @@ func element(value string, matcher realMatcher) Matcher {
return realMatcher{
minLength: matcher.minLength + 1,
maxLength: options.Map(matcher.maxLength, increment),
- accept: func(path []string, vars map[string]string) HandlerFunc {
+ accept: func(path []string, rc Context) HandlerFunc {
if len(path) == 0 || path[0] != value {
return nil
}
- return matcher.accept(path[1:], vars)
+ return matcher.accept(path[1:], rc)
},
}
}