github.com/lambdatest/go-gitignore@v0.0.0-20230214141342-7fe15342e580/match.go (about)

     1  package gitignore
     2  
     3  // Match represents the interface of successful matches against a .gitignore
     4  // pattern set. A Match can be queried to determine whether the matched path
     5  // should be ignored or included (i.e. was the path matched by a negated
     6  // pattern), and to extract the position of the pattern within the .gitignore,
     7  // and a string representation of the pattern.
     8  type Match interface {
     9  	// Ignore returns true if the match pattern describes files or paths that
    10  	// should be ignored.
    11  	Ignore() bool
    12  
    13  	// Include returns true if the match pattern describes files or paths that
    14  	// should be included.
    15  	Include() bool
    16  
    17  	// String returns a string representation of the matched pattern.
    18  	String() string
    19  
    20  	// Position returns the position in the .gitignore file at which the
    21  	// matching pattern was defined.
    22  	Position() Position
    23  }