You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding a MatchBytes() to match a glob pattern against a byte slice would be incredibly useful for searching within files.
For example:
package main
import "github.com/gobwas/glob"
func main() {
var g glob.Glob
g = glob.MustCompile("*.github.com")
g.MatchBytes([]byte("api.github.com")) // true
}
A further justification of this is how the regex package operates on bytes by default. I am not suggesting modifying the default behavior, though, but adding a MatchString() alias could help maintain compatibility if it ever becomes the default.
The text was updated successfully, but these errors were encountered:
Adding a
MatchBytes()
to match a glob pattern against a byte slice would be incredibly useful for searching within files.For example:
A further justification of this is how the
regex
package operates on bytes by default. I am not suggesting modifying the default behavior, though, but adding aMatchString()
alias could help maintain compatibility if it ever becomes the default.The text was updated successfully, but these errors were encountered: