Help us shape the future of Go! Take the 2026 Go Developer Survey

repositorypath

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package repositorypath defines the hard repository-membership boundary shared by source discovery and repository-wide semantic scanners.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsafe = errors.New("unsafe repository path")

ErrUnsafe marks a path that escapes the repository, crosses a symlinked component, or does not name the expected filesystem kind.

Functions

func DirectoryIgnored

func DirectoryIgnored(name string) bool

DirectoryIgnored reports whether name identifies a directory that is always outside a repository's source membership.

func Ignored

func Ignored(path string) bool

Ignored reports whether a normalized or platform-native repository-relative path is always outside source membership. Repository-wide scanners call it once per candidate path per file they key, so it walks the segments in place rather than allocating a split: on a large repository the allocation alone was a measurable share of an indexing run.

func ResolvePath

func ResolvePath(root, relative string) (string, error)

ResolvePath resolves a repository-relative path without following symlinks in any ancestor. The leaf may be missing or itself a symlink so callers that fingerprint those states can inspect it separately.

func ResolveRegularFile

func ResolveRegularFile(root, relative string) (string, fs.FileInfo, error)

ResolveRegularFile applies ResolvePath and additionally requires the leaf to be a real regular file rather than a symlink or special file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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