Documentation ¶
Overview ¶
Package cli contains utilities to work with IO streams.
Index ¶
Constants ¶
This section is empty.
Variables ¶
DefaultIOStreams provides the default streams for os.Stdin, os.Stdout and os.Stderr.
Functions ¶
Types ¶
type IOStreams ¶
IOStreams is a holder for input and output streams. Commands should use this instead of directly relying on os.Stdin, os.Stdout and os.Stderr to make it possible to replace the streams in tests.
func NewTestIOStreams ¶
func NewTestIOStreams() (streams IOStreams, in *bytes.Buffer, out *bytes.Buffer, errOut *bytes.Buffer)
NewTestIOStreams provides IOStreams that use a *bytes.Buffer. This can be used in tests to make assertions on command output as well as control the input stream. Returns IOStreams and *bytes.Buffer for in, out and errOut.
Click to show internal directories.
Click to hide internal directories.