gatus/vendor/github.com/TwinProduction/gocache/pattern.go

13 lines
241 B
Go
Raw Normal View History

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
}