ignore

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Matcher

type Matcher interface {
	IsIgnored(path string, isDir bool) bool
}

Matcher evaluates whether file paths match ignore patterns.

func LoadMatcher

func LoadMatcher(dir string) Matcher

LoadMatcher searches for .gocodeignore (or .gitignore as fallback) starting from dir.

type SensitiveMatcher added in v0.4.0

type SensitiveMatcher struct {
	Inner    Matcher
	Patterns []string
}

SensitiveMatcher wraps an existing Matcher and additionally checks against built-in sensitive file patterns.

func NewSensitiveMatcher added in v0.4.0

func NewSensitiveMatcher(inner Matcher, extraPatterns []string) *SensitiveMatcher

NewSensitiveMatcher creates a matcher that combines the given inner matcher with built-in sensitive file patterns. Additional patterns can be added.

func (*SensitiveMatcher) IsIgnored added in v0.4.0

func (s *SensitiveMatcher) IsIgnored(path string, isDir bool) bool

IsIgnored checks both the inner matcher and the sensitive file patterns.

func (*SensitiveMatcher) IsSensitive added in v0.4.0

func (s *SensitiveMatcher) IsSensitive(path string) string

IsSensitive checks if the given path matches any sensitive file pattern. Returns the matching pattern if sensitive, or empty string if not.

func (*SensitiveMatcher) ShouldBlock added in v0.4.0

func (s *SensitiveMatcher) ShouldBlock(path string, isDir bool) (bool, string)

ShouldBlock combines IsIgnored and IsSensitive checks. Returns (blocked bool, reason string).

Jump to

Keyboard shortcuts

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