check / check (push) Successful in 1m10s
cli.Main no longer calls SetOut or SetErr. SetOut also moved the usage and an unknown help topic, which cobra writes to stderr, onto stdout. execute now takes the command tree, so the tests build it, set its arguments and output streams, and run it; the exit line goes to the command's error stream, which outside a test is stderr as before. Model: opus-5-5
12 lines
310 B
Go
12 lines
310 B
Go
package cli
|
|
|
|
// RootCmd and Execute are rootCmd and execute, exported for the external
|
|
// test package, which builds the command tree itself so that it can
|
|
// supply the arguments and read the output.
|
|
//
|
|
//nolint:gochecknoglobals // test seams, not mutable state.
|
|
var (
|
|
RootCmd = rootCmd
|
|
Execute = execute
|
|
)
|