util

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package util provides shared filesystem utility functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirExists

func DirExists(path string) bool

DirExists returns true if path exists and is a directory.

func FileExists

func FileExists(path string) bool

FileExists returns true if path exists and is a regular file.

func SafeJoin

func SafeJoin(base, path string) (string, error)

SafeJoin safely joins a base directory with a relative path, ensuring the result stays within the base directory. Returns an error if the path would escape the base directory.

Types

type PathEscapeError

type PathEscapeError struct {
	Base string
	Path string
}

PathEscapeError indicates an attempt to escape the base directory.

func (*PathEscapeError) Error

func (e *PathEscapeError) Error() string

Jump to

Keyboard shortcuts

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