Closed donatj closed 7 years ago
It would appear there is an error in how question mark is handled such that the full string is no longer matched against.
Here is a bug I ran into in production
package main import ( "log" "github.com/gobwas/glob" ) func main() { x := glob.MustCompile("sta") log.Println(x.Match("stagnation")) x2 := glob.MustCompile("sta*") log.Println(x2.Match("stagnation")) x3 := glob.MustCompile("sta?") log.Println(x3.Match("stagnation")) x4 := glob.MustCompile("sta?n") log.Println(x4.Match("stagnation")) }
outputs
2016/10/19 17:13:44 false 2016/10/19 17:13:44 true 2016/10/19 17:13:44 true 2016/10/19 17:13:44 true
but I would expect
2016/10/19 17:13:44 false 2016/10/19 17:13:44 true 2016/10/19 17:13:44 false 2016/10/19 17:13:44 false
Which is how glob is handled in bash and zsh:
Hi @donatj! Nice catch! Sorry. Fix will be available in 5 minutes ;-)
@donatj fixed in v0.2.1 tag and in master.
v0.2.1
Awesome! Thank you!
@donatj thank you! 🍻
It would appear there is an error in how question mark is handled such that the full string is no longer matched against.
Here is a bug I ran into in production
outputs
but I would expect
Which is how glob is handled in bash and zsh: