We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents bca0664 + f9b6619 commit 8a6c85fCopy full SHA for 8a6c85f
flag.go
@@ -1156,7 +1156,7 @@ func (f *FlagSet) Parse(arguments []string) error {
1156
}
1157
f.parsed = true
1158
1159
- if len(arguments) < 0 {
+ if len(arguments) == 0 {
1160
return nil
1161
1162
flag_test.go
@@ -100,6 +100,12 @@ func TestEverything(t *testing.T) {
100
101
102
103
+func TestNoArgument(t *testing.T) {
104
+ if GetCommandLine().Parse([]string{}) != nil {
105
+ t.Error("parse failed for empty argument list")
106
+ }
107
+}
108
+
109
func TestUsage(t *testing.T) {
110
called := false
111
ResetForTesting(func() { called = true })
0 commit comments