pathutil

package
v0.13.34 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package pathutil provides shared path sanitization utilities for user-controlled path components used in filesystem operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SafePathComponent

func SafePathComponent(s string) string

SafePathComponent sanitizes a string for safe use as a single path component. It strips directory separators, path traversal sequences, null bytes, and other characters that are problematic in filenames. The result is safe to embed in filepath.Join calls without risk of path traversal.

Types

This section is empty.

Jump to

Keyboard shortcuts

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