pattern

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: MIT Imports: 10 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

func BuildCodeBlockMap

func BuildCodeBlockMap(lines []string) []bool

BuildCodeBlockMap returns a bool slice where index i is true if lines[i] is inside a fenced code block (``` delimited). O(n) single pass.

func DecodeAndRescan

func DecodeAndRescan(target *scanner.Target, compiled []*rules.CompiledRule, cbMap []bool) []scanner.Finding

DecodeAndRescan detects encoded blobs in content, decodes them, and re-scans with provided rules. cbMap is the code block map for the file (nil for non-markdown files).

Types

type Matcher

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

Matcher implements the Analyzer interface using compiled pattern rules.

func NewMatcher

func NewMatcher(compiled []*rules.CompiledRule) *Matcher

NewMatcher creates a new pattern matcher with the given compiled rules.

func (*Matcher) Analyze

func (m *Matcher) Analyze(ctx context.Context, target *scanner.Target) ([]scanner.Finding, error)

func (*Matcher) Name

func (m *Matcher) Name() string

Jump to

Keyboard shortcuts

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