pathutil

package
v0.29.0 Latest Latest
Warning

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

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

Documentation

Overview

Package pathutil provides shared filesystem-path normalization for harness components that must compare local persistence roots safely.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Canonicalize

func Canonicalize(paths []string) ([]string, error)

Canonicalize returns sorted, duplicate-free canonical paths. It resolves the deepest existing prefix of each path through symlinks and then appends any missing suffix. Empty paths are ignored. Any ambiguous resolution fails closed with *CanonicalPathError and no partial result.

Types

type CanonicalPathError

type CanonicalPathError struct {
	Path  string
	Op    string
	Cause error
}

CanonicalPathError reports that a path could not be canonicalized without ambiguity. Path is the original input, Op is the failed resolution step, and Cause is available through errors.Is/As.

func (*CanonicalPathError) Error

func (e *CanonicalPathError) Error() string

func (*CanonicalPathError) Unwrap

func (e *CanonicalPathError) Unwrap() error

Jump to

Keyboard shortcuts

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