Package testutils
provides useful test helpers.
CaptureStdout
,CaptureSterr
andCaptureStdoutAndStderr
: capture stdout, stderr or both for testing purposes. All capture functions are not thread-safe if used in parallel tests, and usually it is better to pass a custom io.Writer to the function under test instead.
go get -u github.com/go-pkgz/testutils