Documentation
¶
Overview ¶
Package util provides miscellaneous utility functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BeNice ¶
BeNice lets a Unix process reduce its own execution priority to avoid impacting other processes. Positive values have lower privilege (are nicer) while negative values have a higher privilege (are MEAN!).
func LogRecover ¶
func LogRecover()
LogRecover helps ensure any unhandled errors are logged. Useful as a `defer` function immediately upon entering a goroutine.
Types ¶
type CommandLogger ¶ added in v0.5.3
type CommandLogger struct { Log func(string) // contains filtered or unexported fields }
CommandLogger is used when newline-terminated output should be logged (e.g. from exec.Command).
func (*CommandLogger) Close ¶ added in v0.5.3
func (cl *CommandLogger) Close() error
Close implments io.WriteCloser by flushing any remaining string in the local buffer out to the logger and resets the buffer.
Click to show internal directories.
Click to hide internal directories.