filepathutil

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurLeafDir

func CurLeafDir() (string, error)

CurLeafDir returns the leaf dir of a nested directory.

func FilterFilepaths

func FilterFilepaths(paths []string, inclExists, inclNotExists, inclFiles, inclDirs bool) []string

FilterFilepaths filters a slice of filepaths using various options.

func Trim

func Trim(file string) string

Trim trims the provided filepath using `os.PathSeparator`

func TrimLeft

func TrimLeft(file string) string

TrimLeft left trims the provided filepath using `os.PathSeparator`

func TrimRight

func TrimRight(file string) string

TrimRight right trims the provided filepath using `os.PathSeparator`

func UserToAbsolute

func UserToAbsolute(file string) (string, error)

UserToAbsolute converts ~ directories to absolute directories in filepaths. This is useful because ~ cannot be resolved by ioutil.ReadFile().

Types

This section is empty.

Jump to

Keyboard shortcuts

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