Skip to content

Commit

Permalink
fix: no need to ignore testing anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
jnovack committed Apr 2, 2021
1 parent 802519a commit 94cdd4b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion extras_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
7 changes: 1 addition & 6 deletions flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 94cdd4b

Please sign in to comment.