1
0
Fork 0
golang-github-twin-gocache/pattern.go
Daniel Baumann 02ef45af86
Adding upstream version 2.2.2.
Signed-off-by: Daniel Baumann <daniel@debian.org>
2025-05-16 22:45:16 +02:00

12 lines
241 B
Go

package gocache
import "path/filepath"
// MatchPattern checks whether a string matches a pattern
func MatchPattern(pattern, s string) bool {
if pattern == "*" {
return true
}
matched, _ := filepath.Match(pattern, s)
return matched
}