-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Run instead of RunE to avoid showing the command help when the co…
…mmand fails. Signed-off-by: Daniel Ortiz <[email protected]>
- Loading branch information
Showing
3 changed files
with
13 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ import ( | |
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func Test_pluginFunc(t *testing.T) { | ||
func Test_pluginFuncErr(t *testing.T) { | ||
var buf bytes.Buffer | ||
cmd := &cobra.Command{} | ||
cmd.SetOutput(&buf) | ||
|
@@ -78,7 +78,7 @@ go get golang.org/x/[email protected] | |
gogetEnabled = tc.fix | ||
defer func() { gogetEnabled = fix }() | ||
|
||
err := pluginFunc(cmd, nil) | ||
err := pluginFuncErr(cmd, nil) | ||
if tc.err != "" { | ||
require.EqualError(t, err, tc.err) | ||
} else { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters