From f34ee269e9effa89dc4c04ebf3517211094f2710 Mon Sep 17 00:00:00 2001 From: Astone <11812510+acynothia@users.noreply.github.com> Date: Mon, 4 Nov 2024 17:56:33 +0800 Subject: [PATCH] fix: remove duplicated matcher split (#834) --- scope_strategy.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scope_strategy.go b/scope_strategy.go index 0c4bbad6..33b5b673 100644 --- a/scope_strategy.go +++ b/scope_strategy.go @@ -52,13 +52,12 @@ func WildcardScopeStrategy(matchers []string, needle string) bool { needleParts := strings.Split(needle, ".") for _, matcher := range matchers { matcherParts := strings.Split(matcher, ".") - if len(matcherParts) > len(needleParts) { continue } var noteq bool - for k, c := range strings.Split(matcher, ".") { + for k, c := range matcherParts { // this is the last item and the lengths are different if k == len(matcherParts)-1 && len(matcherParts) != len(needleParts) { if c != "*" {