Documentation ¶
Index ¶
- func AssertStrings(as []any) ([]string, error)
- func BytesAreEmptyIsh(b []byte) bool
- func CountDir(dir string) (int, int64, error)
- func FilterNil[T any](list []*T) []*T
- func FmtSemver(s string) string
- func IndexIfOK[T any](list []T, i int) (T, bool)
- func PrettyBytes(size int64) string
- func TerminalWidth(fallback int) int
- func ToAny[T any](list []T) []any
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertStrings ¶
AssertStrings converts a slice of any into a slice of strings.
func BytesAreEmptyIsh ¶
BytesAreEmptyIsh checks if the provided byte slice is practically empty. Can handle cases where a nil pointer or empty struct were marshalled to YAML.
func IndexIfOK ¶ added in v0.2.0
IndexIfOK returns the value at the index if it is a valid index for the slice.
func PrettyBytes ¶
PrettyBytes returns the number of bytes formatted for human readability.
func TerminalWidth ¶
TerminalWidth returns the width of the terminal, using fallback if it can't determine width.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.