pathutil

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EvalSymlinksCached added in v1.15.0

func EvalSymlinksCached(ctx context.Context, path string) (string, error)

func Excluded added in v1.7.0

func Excluded(filePath string, ignorePaths, onlyPaths []string) bool

Excluded reports whether filePath should be dropped given ignore-paths and only-paths lists. A file is excluded if it matches any ignorePaths pattern; otherwise, when onlyPaths is non-empty, it is excluded unless it matches one of them. Patterns use MatchesPath semantics.

func MatchesPath

func MatchesPath(pattern, filePath string) bool

MatchesPath reports whether filePath is covered by pattern. pattern may be a literal path, a directory prefix, a single-star glob (*, ?, [...]), or a double-star glob (**) where ** matches zero or more path segments. Both arguments are normalized to forward slashes for OS-independent behavior.

func PathEscapesDir added in v1.15.0

func PathEscapesDir(rel string) bool

func WithResolvedPathCache added in v1.15.0

func WithResolvedPathCache(ctx context.Context) context.Context

WithResolvedPathCache attaches a scan-scoped EvalSymlinks cache to ctx. Nested calls reuse the existing cache so graph walking and evaluation share hits.

Types

This section is empty.

Jump to

Keyboard shortcuts

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