1
0
Fork 0
mirror of https://github.com/TwiN/gatus.git synced 2024-12-14 11:58:04 +00:00
twin-gatus/pattern/pattern.go

13 lines
227 B
Go
Raw Normal View History

2020-10-01 23:57:11 +00:00
package pattern
import "path/filepath"
// Match checks whether a string matches a pattern
func Match(pattern, s string) bool {
if pattern == "*" {
return true
}
matched, _ := filepath.Match(pattern, s)
return matched
}