| 1 |
package gocache |
| 2 |
|
| 3 |
import "path/filepath" |
| 4 |
|
| 5 |
// MatchPattern checks whether a string matches a pattern |
| 6 |
func MatchPattern(pattern, s string) bool { |
| 7 |
if pattern == "*" { |
| 8 |
return true |
| 9 |
} |
| 10 |
matched, _ := filepath.Match(pattern, s) |
| 11 |
return matched |
| 12 |
} |