From 1635adc08aa413bbd7d2cf67e66ad6e9a823169a Mon Sep 17 00:00:00 2001 From: Stefan Majewsky Date: Fri, 2 Oct 2026 15:02:43 +0200 Subject: 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. --- pathrouter/here.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pathrouter/here.go') diff --git a/pathrouter/here.go b/pathrouter/here.go index a59cdf0..bf21016 100644 --- a/pathrouter/here.go +++ b/pathrouter/here.go @@ -43,9 +43,9 @@ func here(matcher realMatcher) Matcher { return realMatcher{ minLength: 0, maxLength: Some(1), - accept: func(path []string, vars map[string]string) HandlerFunc { + accept: func(path []string, rc Context) HandlerFunc { if len(path) == 0 || (len(path) == 1 && path[0] == "") { - return matcher.accept(nil, vars) + return matcher.accept(nil, rc) } return nil }, -- cgit v1.3.1