Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UndoFunction ¶
type UndoFunction func() error
UndoFunction will reverse the redirection
func RedirectStderr ¶
func RedirectStderr(f *os.File) (UndoFunction, error)
RedirectStderr to the file passed in, so that the output of any panics that occur will be sent to that file. The caller may close the file after this function returns.
Of course, anything else written to stderr will also be sent to that file, so don't do that unless that's your intent.
Returns a function that can be used to revert stderr back to the console, or an error if stderr could not be redirected
Click to show internal directories.
Click to hide internal directories.