...

Source file src/github.com/monochromegane/go-gitignore/patterns.go

Documentation: github.com/monochromegane/go-gitignore

     1  package gitignore
     2  
     3  type patterns struct {
     4  	patterns []pattern
     5  }
     6  
     7  func (ps *patterns) add(pattern pattern) {
     8  	ps.patterns = append(ps.patterns, pattern)
     9  }
    10  
    11  func (ps *patterns) size() int {
    12  	return len(ps.patterns)
    13  }
    14  
    15  func (ps patterns) match(path string, isDir bool) bool {
    16  	for _, p := range ps.patterns {
    17  		if match := p.match(path, isDir); match {
    18  			return true
    19  		}
    20  	}
    21  	return false
    22  }
    23  

View as plain text