Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Exists ¶
Exists checks if a given filepath exists. Note that it's usually better to just use os.Open/1 when interacting with the file to avoid race-conditions.
func IsStdinPiped ¶
func IsStdinPiped() bool
IsStdinPiped checks if data is being piped to os.Stdin or if os.Stdin is from a terminal.
func IsStdinReadable ¶
func IsStdinReadable() bool
IsStdinReadable checks if os.Stdin is open for reading in a blocking way.
func IsStdinTerminal ¶
func IsStdinTerminal() bool
IsStdinTerminal returns true if stdin is a terminal.
func IsTerminal ¶
IsTerminal returns true if the given file descriptor is a terminal.
func LogCloseError ¶
LogCloseError is a helper function which logs close errors. Useful in defers. Optionally accepts a format string. e.g, defer LogCloseError(fd.Close, "Failed to close fd")
func WaitForSignals ¶
WaitForSignals listens looping for syscall signals until the given signal handler returns true. Common uses are CTRL-T, CTRL-C, CTRL-D, CTRL-Z.
Note SIGQUIT (CTRL-\) is not handle on purpose to not accidentally override Go's stacktracing.
Types ¶
This section is empty.