From: Rob Pike Date: Mon, 27 Feb 2012 05:23:22 +0000 (+1100) Subject: cmd/go: run examples even if -run is set if -example is also set X-Git-Tag: weekly.2012-03-04~136 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=28668c3a28c8eee186362692af981d9f4fc4fc96;p=gostls13.git cmd/go: run examples even if -run is set if -example is also set 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 --- diff --git a/src/pkg/testing/example.go b/src/pkg/testing/example.go index c48d0d8159..70b69e9962 100644 --- a/src/pkg/testing/example.go +++ b/src/pkg/testing/example.go @@ -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