util

package
v1.1.65 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsWithinPath added in v1.1.65

func IsWithinPath(parent, candidate string) (bool, error)

IsWithinPath reports whether candidate is equal to or below parent after resolving all existing symlinks in both paths.

func ResolvePathWithExistingSymlinks(path string) (string, error)

ResolvePathWithExistingSymlinks returns an absolute path after resolving all existing components. Missing descendants are retained beneath the resolved nearest existing ancestor.

func TruncateString

func TruncateString(s string, maxBytes int) string

TruncateString returns a valid UTF-8 prefix of s whose byte length is at most maxBytes.

func TruncateWithSuffix

func TruncateWithSuffix(s string, maxBytes int, suffix string) string

TruncateWithSuffix truncates s with TruncateString and appends suffix when truncation occurs.

Types

This section is empty.

Jump to

Keyboard shortcuts

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