func (rs ignoreRuleset) Match(path string, isDir bool) bool {
	// To properly support start-of-pathname patterns all paths must
	// begin with a /
	if len(path) > 0 && path[0] != '/' {
		path = "/" + path
	}

	var keep = true
	for _, r := range rs {
		switch r(path, isDir) {
		case ruleResultKeep:
			// Keep file unless already excluded
			if !keep {
				continue
			}

			keep = true
		case ruleResultSkip:
			keep = false
		case ruleResultForceKeep:
			// Keep file even if already excluded (inverted rule)
			keep = true
		}
	}

	return !keep
}
// Match returns true if path matches any of the ignore rules in the set.
Match returns true if path matches any of the ignore rules in the set.
// Match returns true if path matches any of the ignore rules in the set .
func (rs ignoreRuleset) Match(path string, isDir bool) bool {
	if len(path) > 0 && path[0] != '/' {
		path = "/" + path
	}
	var keep = true
	for _, r := range rs {
		switch r(path, isDir) {
		case ruleResultKeep:
			if !keep {
				continue
			}
			keep = true
		case ruleResultSkip:
			keep = false
		case ruleResultForceKeep:
			keep = true
		}
	}
	return !keep
}
func ( rs ignoreRuleset ) Match ( path string , isDir bool ) bool { if len ( path ) > 0 && path [ 0 ] != '/' { path = " " + path } var keep = true for _ , r := range rs { switch r ( path , isDir ) { case ruleResultKeep : if ! keep { continue } keep = true case ruleResultSkip : keep = false case ruleResultForceKeep : keep = true } } return ! keep }
Match returns true if path matches any of the ignore rules in the set.
Match returns true if path matches any of the ignore rules in the set .
// To properly support start-of-pathname patterns all paths must // begin with a / // Keep file unless already excluded // Keep file even if already excluded (inverted rule)