github.com/boyter/gocodewalker@v1.3.2/go-gitignore/match.go (about)

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