pathutil

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base

func Base(value string) string

Base returns the last path element while treating both slash styles as separators. Use this for parsing stored path strings that may originate from another OS.

func Clean

func Clean(value string) string

Clean normalizes path-like strings for cross-platform parsing by treating both slash styles as separators. Use this for metadata/source-path parsing, not filesystem operations.

func IsWithinRoot

func IsWithinRoot(root string, target string) bool

IsWithinRoot reports whether target resolves to root or a descendant of root. It first checks lexical paths, then repeats the check with symlinks resolved through the nearest existing path prefix so missing child paths under a symlink cannot escape the root.

func SamePath

func SamePath(left string, right string) bool

SamePath compares local filesystem paths with the host OS path semantics.

Types

This section is empty.

Jump to

Keyboard shortcuts

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