Skip to content
Myr

Use nil instead of len for arg check.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

This honors the SetArgs() call

authored by Jonathan Reyna · committed by Steve Francia · parent bbdcadf · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:command.go+1 added-1 removed
633 unmodified lines
634635 var args []string636637 // Workaround FAIL with "go test -v" or "cobra.test -test.v", see #155638 if len(c.args) == 0 && filepath.Base(os.Args[0]) != "cobra.test" {638 if c.args == nil && filepath.Base(os.Args[0]) != "cobra.test" {639 args = os.Args[1:]640 } else {641 args = c.args642 }
555 unmodified lines