Skip to content

Commit 1ef0913

Browse files
jonreynaspf13
authored andcommitted
Use nil instead of len for arg check.
This honors the SetArgs() call
1 parent bbdcadf commit 1ef0913

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

command.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ func (c *Command) ExecuteC() (cmd *Command, err error) {
635635
var args []string
636636

637637
// Workaround FAIL with "go test -v" or "cobra.test -test.v", see #155
638-
if len(c.args) == 0 && filepath.Base(os.Args[0]) != "cobra.test" {
638+
if c.args == nil && filepath.Base(os.Args[0]) != "cobra.test" {
639639
args = os.Args[1:]
640640
} else {
641641
args = c.args

0 commit comments

Comments
 (0)