File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -47,11 +47,6 @@ import (
47
47
"github.com/stretchr/testify/require"
48
48
)
49
49
50
- /*
51
- NOTE: the use of func init() for test is discouraged, please create public InitFunctions and call them,
52
- or use (untested) cmd.PersistentPreRun or cmd.PreRun to reinitialize the flags and the commands every time.
53
- */
54
-
55
50
// Utility functions
56
51
57
52
// Redirecting stdOut so we can analyze output line by
Original file line number Diff line number Diff line change @@ -125,9 +125,11 @@ var Command = &cobra.Command{
125
125
126
126
func preRun (cmd * cobra.Command , args []string ) {
127
127
// Reset logrus if debug flag changed.
128
- if ! commands .GlobalFlags .Debug { // Discard logrus output if no debug.
129
- logrus .SetOutput (ioutil .Discard ) // For standard logger.
130
- } else { // Else print on stderr.
128
+ if ! commands .GlobalFlags .Debug {
129
+ // Discard logrus output if no debug.
130
+ logrus .SetOutput (ioutil .Discard )
131
+ } else {
132
+ // Else print on stderr.
131
133
commands .ErrLogrus .Out = os .Stderr
132
134
formatter .SetLogger (commands .ErrLogrus )
133
135
}
You can’t perform that action at this time.
0 commit comments