From 44cd19510987b954457cdd845b1bf0b80d164e44 Mon Sep 17 00:00:00 2001 From: GRMrGecko Date: Fri, 9 Aug 2024 13:17:57 -0500 Subject: [PATCH] Fix glob in exclude check. --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 23d5b40..0a33f6e 100644 --- a/main.go +++ b/main.go @@ -18,7 +18,7 @@ import ( const ( serviceName = "nginx-cache-purge" serviceDescription = "Tool to help purge Nginx cache " - serviceVersion = "0.1.3" + serviceVersion = "0.1.4" ) // App structure to access global app variables. @@ -43,7 +43,7 @@ func (a *App) PurgeCache(CachePath string, Key string, ExcludeKeys []string) err for _, exclude := range ExcludeKeys { if globRegex.MatchString(exclude) { g, err := glob.Compile(exclude) - if err != nil && g != nil && g.Match(Key) { + if err == nil && g != nil && g.Match(Key) { return true } }