Work on #16: Support patterns

This commit is contained in:
TwinProduction
2020-10-01 19:57:11 -04:00
parent 18d3236586
commit 8101646ba5
5 changed files with 142 additions and 4 deletions

12
pattern/pattern.go Normal file
View File

@ -0,0 +1,12 @@
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
}