Documentation
¶
Overview ¶
Package ignore decides which files to skip when packaging a project tree. It applies a built-in list of always-ignored patterns, any extras supplied by the caller, and the project's .gitignore (when present at the root).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
Matcher decides whether a path should be excluded from an archive.
func NewProjectMatcher ¶
NewProjectMatcher returns a Matcher rooted at root. The default ignore patterns are always applied. extraPatterns are layered on top, and the root .gitignore (if present) is consulted last.
func (*Matcher) ProjectRelPath ¶
ProjectRelPath returns absPath relative to the matcher root using forward slashes. It is intended for callers that walk files outside the immediate project root and need a path to feed back into ShouldIgnoreWith.
func (*Matcher) ShouldIgnore ¶
ShouldIgnore reports whether relPath should be skipped. relPath is used for both pattern matching and gitignore lookup. Use ShouldIgnoreWith when those paths differ (for example, when archiving shared files from outside the walked tree).