Documentation
¶
Overview ¶
Package util contains several utility functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChildPath ¶
ChildPath returns the child path with respect to the base directory or returns an error if the target directory is not a child of the base directory.
func PathEvalAbs ¶
PathEvalAbs returns the absolute path for a directory after evaluating symlinks.
func PtrVal ¶
func PtrVal[T any](v *T) T
PtrVal returns the value of the given pointer. If the provided input is nil, it returns the zero value for the pointer's underlying type.
func SortedMapKeys ¶
SortedMapKeys returns the sorted slice of map key strings.
Types ¶
type ExitCodeError ¶ added in v1.0.8
type ExitCodeError struct {
Code int
// Err may be nil if nothing went wrong, but we still want to exit with a
// nonzero status
Err error
}
ExitCodeErr is an implementation of the error interface that contains an command exit status. This is intended to be returned from a Run() function when a command wants to return a specific error code to the OS.
func (*ExitCodeError) Error ¶ added in v1.0.8
func (e *ExitCodeError) Error() string
func (*ExitCodeError) Unwrap ¶ added in v1.0.8
func (e *ExitCodeError) Unwrap() error