mirror of
https://github.com/TwiN/gatus.git
synced 2024-12-12 17:50:55 +01:00
13 lines
241 B
Go
13 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
|
||
|
}
|