file

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteDir

func DeleteDir(path string) error

DeleteDir deletes the directory at the given path. It returns nil if the deletion succeeds, or the deletion error otherwise. If the directory does not exist, DeleteDir returns nil.

func ExpandFileList added in v1.7.0

func ExpandFileList(fileList []string) ([]string, error)

ExpandFileList takes a list of file globs and expands them into a list of matching file paths. It returns the expanded file list and any errors from glob matching. This allows safely passing user input globs through to glob matching.

func ReadStringOrFile

func ReadStringOrFile(input string) (string, bool, error)

ReadStringOrFile returns the content of a string or a file if the file exists. The returned boolean value indicates whether the specified `input` was a file path or not.

Types

This section is empty.

Jump to

Keyboard shortcuts

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