fsxutil

package
v1.0.0-beta.24 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGitIgnoreMarkedFS added in v0.19.11

func NewGitIgnoreMarkedFS(fs fsutil.FS, matcher *GitignoreMatcher) (fsutil.FS, error)

NewGitIgnoreMarkedFS creates a new FS that marks gitignored paths in Stat.GitIgnored. The returned FS still walks the full tree (to preserve negation semantics), but it leaves filtering decisions to the consumer.

func RootPath

func RootPath(root, p string) (string, error)

RootPath resolves p under root as continuity's fs.RootPath does, following symlinks within root. A path that holds no symlinks, the common case, is settled with one lookup where continuity's walk takes an lstat, and several allocations, per component; any other path is walked by continuity.

func RootPathWithoutSymlinks(root, p string, followFinalSymlink bool) (string, bool)

RootPathWithoutSymlinks settles, with one lookup, the common case of a path that holds no symlinks, which resolves to itself under root. A final symlink counts only when followFinalSymlink is set. ok is false when the lookup can't settle it: a symlink anywhere in the path, root's own components included, any error but a missing component, a ".." component, or a platform without the lookup. Every component before a missing one is a directory, and continuity's walk takes the missing ones as they are. Continuity takes a ".." after the symlinks before it, so cleaning it away first could change the answer.

Types

type GitignoreMatcher

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

func NewGitIgnoreMatcher

func NewGitIgnoreMatcher(fs fsutil.FS) *GitignoreMatcher

NewGitIgnoreMatcher creates a new GitignoreMatcher for the given FS

func NewGitIgnoreMatcherWithOverrides

func NewGitIgnoreMatcherWithOverrides(fs fsutil.FS, overrides map[string]string) *GitignoreMatcher

func (*GitignoreMatcher) Matches

func (gfs *GitignoreMatcher) Matches(path string, isDir bool) (out bool, _ error)

Matches checks if a path should be ignored based on gitignore rules

Jump to

Keyboard shortcuts

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