gitignore

package module
v0.0.0-...-df7b1bc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MatchResult

type MatchResult int

MatchResult defines outcomes of a match, no match, exclusion or inclusion.

const (
	// NoMatch defines the no match outcome of a match check
	NoMatch MatchResult = iota
	// Exclude defines an exclusion of a file as a result of a match check
	Exclude
	// Include defines an explicit inclusion of a file as a result of a match check
	Include
)

type Matcher

type Matcher struct {
	// contains filtered or unexported fields
}

Matcher defines a matcher for a single gitignore pattern

func NewMatcher

func NewMatcher(pattern Pattern) *Matcher

NewMatcher constructs a new simple matcher for a single pattern

func (*Matcher) Match

func (m *Matcher) Match(path []string, isDir bool) bool

Match matches the given path against the single pattern

type Pattern

type Pattern interface {
	// Match matches the given path to the pattern.
	Match(path []string, isDir bool) MatchResult
}

Pattern defines a single gitignore pattern.

func ParsePattern

func ParsePattern(p string, domain []string) Pattern

ParsePattern parses a gitignore pattern string into the Pattern structure.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL