mirror of https://github.com/tidwall/tile38.git
19 lines
345 B
Go
19 lines
345 B
Go
|
package controller
|
||
|
|
||
|
import "path"
|
||
|
|
||
|
func globMatch(pattern, name string) (matched bool, err error) {
|
||
|
return path.Match(pattern, name)
|
||
|
}
|
||
|
|
||
|
func globIsGlob(pattern string) bool {
|
||
|
for i := 0; i < len(pattern); i++ {
|
||
|
switch pattern[i] {
|
||
|
case '[', '*', '?':
|
||
|
_, err := globMatch(pattern, "whatever")
|
||
|
return err == nil
|
||
|
}
|
||
|
}
|
||
|
return false
|
||
|
}
|