mirror of https://github.com/tidwall/tile38.git
match on prefix star, fixes #76w
This commit is contained in:
parent
fbff0f4eef
commit
d6f83adb30
|
@ -1,5 +1,7 @@
|
||||||
package glob
|
package glob
|
||||||
|
|
||||||
|
import "strings"
|
||||||
|
|
||||||
type Glob struct {
|
type Glob struct {
|
||||||
Pattern string
|
Pattern string
|
||||||
Desc bool
|
Desc bool
|
||||||
|
@ -24,7 +26,7 @@ func IsGlob(pattern string) bool {
|
||||||
|
|
||||||
func Parse(pattern string, desc bool) *Glob {
|
func Parse(pattern string, desc bool) *Glob {
|
||||||
g := &Glob{Pattern: pattern, Desc: desc, Limits: []string{"", ""}}
|
g := &Glob{Pattern: pattern, Desc: desc, Limits: []string{"", ""}}
|
||||||
if pattern == "*" {
|
if strings.HasPrefix(pattern, "*") {
|
||||||
g.IsGlob = true
|
g.IsGlob = true
|
||||||
return g
|
return g
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue