func ignoreGlobMatch(pattern string) (ignoreRuleEvalFn, error) {
	var (
		err              error
		expandedPatterns = genIgnorePatternPermutations(pattern)
		globPats         = make([]glob.Glob, len(expandedPatterns))
	)

	for i, pat := range expandedPatterns {
		globPats[i], err = glob.Compile(pat, '/')
		if err != nil {
			return nil, err
		}
	}

	return func(path string, isDir bool) ruleResult {
		for _, globPat := range globPats {
			if globPat.Match(path) {
				return ruleResultSkip
			}
		}

		return ruleResultKeep
	}, nil
}
// ignoreGlobMatch constructs a ignoreRuleEvalFn that returns ruleResultSkip
// when the input matches any of the provided glob patterns. If an invalid glob
// pattern is provided then ignoreGlobMatch returns an error.
ignoreGlobMatch constructs a ignoreRuleEvalFn that returns ruleResultSkip
when the input matches any of the provided glob patterns. If an invalid glob
pattern is provided then ignoreGlobMatch returns an error.
// ignoreGlobMatch constructs a ignoreRuleEvalFn that returns ruleResultSkip // when the input matches any of the provided glob patterns . If an invalid glob // pattern is provided then ignoreGlobMatch returns an error .
func ignoreGlobMatch(pattern string) (ignoreRuleEvalFn, error) {
	var (
		err              error
		expandedPatterns = genIgnorePatternPermutations(pattern)
		globPats         = make([]glob.Glob, len(expandedPatterns))
	)
	for i, pat := range expandedPatterns {
		globPats[i], err = glob.Compile(pat, '/')
		if err != nil {
			return nil, err
		}
	}
	return func(path string, isDir bool) ruleResult {
		for _, globPat := range globPats {
			if globPat.Match(path) {
				return ruleResultSkip
			}
		}
		return ruleResultKeep
	}, nil
}
func ignoreGlobMatch ( pattern string ) ( ignoreRuleEvalFn , error ) { var ( err error expandedPatterns = genIgnorePatternPermutations ( pattern ) globPats = make ( [ ] glob . Glob , len ( expandedPatterns ) ) ) for i , pat := range expandedPatterns { globPats [ i ] , err = glob . Compile ( pat , '/' ) if err != nil { return nil , err } } return func ( path string , isDir bool ) ruleResult { for _ , globPat := range globPats { if globPat . Match ( path ) { return ruleResultSkip } } return ruleResultKeep } , nil }
ignoreGlobMatch constructs a ignoreRuleEvalFn that returns ruleResultSkip
when the input matches any of the provided glob patterns.
ignoreGlobMatch constructs a ignoreRuleEvalFn that returns ruleResultSkip when the input matches any of the provided glob patterns .