utils

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatDuration

func FormatDuration(d time.Duration) string

func IsZeroAny added in v1.2.1

func IsZeroAny(v any) bool

func ReadPipedInput

func ReadPipedInput() string

ReadPipedInput reads all data from standard input when stdin is being piped, and returns it as a UTF-8 string.

If stdin is attached to an interactive terminal (TTY), there is no piped input, so ReadPipedInput returns an empty string.

This is useful for CLIs that support both:

echo "hello" | cli

and normal interactive usage without blocking on stdin.

On read failure, this function terminates the process via timber.Fatal.

Types

This section is empty.

Jump to

Keyboard shortcuts

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