Work on #16: Support patterns
This commit is contained in:
1 parent
18d3236586
commit
8101646ba5
5 files changed
+142
-4
No files matched your search
@@ -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
|
||||
}
|
||||
Reference in new issue
Block a user