]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: run examples even if -run is set if -example is also set
authorRob Pike <r@golang.org>
Mon, 27 Feb 2012 05:23:22 +0000 (16:23 +1100)
committerRob Pike <r@golang.org>
Mon, 27 Feb 2012 05:23:22 +0000 (16:23 +1100)
Allows one to disable everything but the example being debugged.
This time for sure.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5700079

src/pkg/testing/example.go

index c48d0d8159dc4aa434fe68cda034350dd623907b..70b69e9962f445711e6bdc53e42313a82370a068 100644 (file)
@@ -23,7 +23,7 @@ type InternalExample struct {
 }
 
 func RunExamples(matchString func(pat, str string) (bool, error), examples []InternalExample) (ok bool) {
-       if *match != "" {
+       if *match != "" && *matchExamples == "" {
                return // Don't run examples if testing is restricted: we're debugging.
        }
        ok = true