mirror of
https://github.com/TwiN/gatus.git
synced 2024-11-22 07:53:38 +01:00
13 lines
227 B
Go
13 lines
227 B
Go
|
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
|
||
|
}
|