func NewPathGlobMatch(arg string, truth bool) (*GlobMatch, error) {
	if len(arg) > 0 && arg[0] == '/' {
		arg = arg[1:]
	}
	g, err := glob.Compile(arg, '/')
	if err != nil {
		return nil, err
	}
	return &GlobMatch{orig: arg, matcher: g, normal: truth}, nil
}
NewPathGlobMatch compiles a new matcher.
Arg true should be set to false if the output is inverted.
package ignore
import (
	"bytes"
	"fmt"
	"github.com/gobwas/glob"
)
type Matcher interface {
	Match(string) bool
	True() bool
	MarshalText() ([]byte, error)
}
type MultiMatch struct {
	matchers []Matcher
}
func NewMultiMatch(matchers []Matcher) *MultiMatch {
	return &MultiMatch{matchers: matchers}
}
func (mm *MultiMatch) Match(arg string) bool {
	use := false
	for _, m := range mm.matchers {
		if m.Match(arg) {
			use = m.True()
		}
	}
	return use
}
func (mm *MultiMatch) True() bool { return true }
func (mm *MultiMatch) MarshalText() ([]byte, error) {
	return []byte("multi"), nil
}
type GlobMatch struct {
	orig    string
	matcher glob.Glob
	normal  bool
}
func NewGlobMatch(arg []byte) (*GlobMatch, error) {
	truth := true
	if len(arg) > 0 && arg[0] == '!' {
		truth = false
		arg = arg[1:]
	}
	if bytes.IndexByte(arg, '/') == -1 {
		return NewBaseGlobMatch(string(arg), truth)
	}
	return NewPathGlobMatch(string(arg), truth)
}
func NewBaseGlobMatch(arg string, truth bool) (*GlobMatch, error) {
	g, err := glob.Compile(arg)
	if err != nil {
		return nil, err
	}
	return &GlobMatch{orig: arg, matcher: g, normal: truth}, nil
}