diff --git a/extras_test.go b/extras_test.go index 40f0770..e9483c5 100644 --- a/extras_test.go +++ b/extras_test.go @@ -197,7 +197,7 @@ func TestFlagSetParseErrors(t *testing.T) { func TestTestingPackageFlags(t *testing.T) { f := NewFlagSet("test", ContinueOnError) - if err := f.Parse([]string{"-test.v", "-test.count", "1"}); err != nil { + if err := f.Parse([]string{"-test.v", "-test.count", "1"}); err == nil { t.Error(err) } } diff --git a/flag.go b/flag.go index e40c6ca..539ff63 100644 --- a/flag.go +++ b/flag.go @@ -912,7 +912,7 @@ func (f *FlagSet) failf(format string, a ...interface{}) error { // or the appropriate default usage function otherwise. func (f *FlagSet) usage() { if f.Usage == nil { - f.defaultUsage() + f.defaultUsage() } else { f.Usage() } @@ -940,11 +940,6 @@ func (f *FlagSet) parseOne() (bool, error) { return false, f.failf("bad flag syntax: %s", s) } - // ignore go test flags - if strings.HasPrefix(name, "test.") { - return false, nil - } - // it's a flag. does it have an argument? f.args = f.args[1:] hasValue := false