pathutil

package
v0.0.0-...-2c87074 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Unlicense Imports: 3 Imported by: 30

Documentation

Overview

Package pathutil implements path utility functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileName

func FileName(filePath string) string

FileName returns the base name of filePath without its extension.

func TrimExt

func TrimExt(filePath string) string

TrimExt returns filePath without its extension.

Types

type Base

type Base string

Base corresponds to a base directory.

func (Base) Path

func (base Base) Path(relPath string) (string, error)

Path returns a sanitized concatenation of base and relPath. The implementation takes extra precausions to avoid directory traversal vulnerabilities.

Jump to

Keyboard shortcuts

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