@@ -116,7 +116,7 @@ func TestCommand(t *testing.T) {
116
116
),
117
117
)
118
118
if verbose {
119
- i .Stdout .Write ([]byte ("!!!" ))
119
+ _ , _ = i .Stdout .Write ([]byte ("!!!" ))
120
120
}
121
121
return nil
122
122
},
@@ -129,7 +129,8 @@ func TestCommand(t *testing.T) {
129
129
t .Parallel ()
130
130
i := cmd ().Invoke ("toupper" , "hello" )
131
131
io := fakeIO (i )
132
- i .Run ()
132
+ err := i .Run ()
133
+ require .NoError (t , err )
133
134
require .Equal (t , "HELLO" , io .Stdout .String ())
134
135
})
135
136
@@ -139,7 +140,9 @@ func TestCommand(t *testing.T) {
139
140
"up" , "hello" ,
140
141
)
141
142
io := fakeIO (i )
142
- i .Run ()
143
+ err := i .Run ()
144
+ require .NoError (t , err )
145
+
143
146
require .Equal (t , "HELLO" , io .Stdout .String ())
144
147
})
145
148
@@ -326,7 +329,7 @@ func TestCommand_DeepNest(t *testing.T) {
326
329
{
327
330
Use : "3" ,
328
331
Handler : func (i * serpent.Invocation ) error {
329
- i .Stdout .Write ([]byte ("3" ))
332
+ _ , _ = i .Stdout .Write ([]byte ("3" ))
330
333
return nil
331
334
},
332
335
},
@@ -432,7 +435,7 @@ func TestCommand_RawArgs(t *testing.T) {
432
435
if v := i .ParsedFlags ().Lookup ("password" ).Value .String (); v != "codershack" {
433
436
return xerrors .Errorf ("password %q is wrong!" , v )
434
437
}
435
- i .Stdout .Write ([]byte (strings .Join (i .Args , " " )))
438
+ _ , _ = i .Stdout .Write ([]byte (strings .Join (i .Args , " " )))
436
439
return nil
437
440
}),
438
441
},
@@ -480,7 +483,7 @@ func TestCommand_RootRaw(t *testing.T) {
480
483
cmd := & serpent.Cmd {
481
484
RawArgs : true ,
482
485
Handler : func (i * serpent.Invocation ) error {
483
- i .Stdout .Write ([]byte (strings .Join (i .Args , " " )))
486
+ _ , _ = i .Stdout .Write ([]byte (strings .Join (i .Args , " " )))
484
487
return nil
485
488
},
486
489
}
@@ -497,7 +500,7 @@ func TestCommand_HyphenHyphen(t *testing.T) {
497
500
t .Parallel ()
498
501
cmd := & serpent.Cmd {
499
502
Handler : (func (i * serpent.Invocation ) error {
500
- i .Stdout .Write ([]byte (strings .Join (i .Args , " " )))
503
+ _ , _ = i .Stdout .Write ([]byte (strings .Join (i .Args , " " )))
501
504
return nil
502
505
}),
503
506
}
@@ -538,7 +541,7 @@ func TestCommand_Help(t *testing.T) {
538
541
return & serpent.Cmd {
539
542
Use : "root" ,
540
543
HelpHandler : (func (i * serpent.Invocation ) error {
541
- i .Stdout .Write ([]byte ("abdracadabra" ))
544
+ _ , _ = i .Stdout .Write ([]byte ("abdracadabra" ))
542
545
return nil
543
546
}),
544
547
Handler : (func (i * serpent.Invocation ) error {
0 commit comments