1
0
mirror of https://github.com/golang/go synced 2024-11-14 07:20:22 -07:00

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
This commit is contained in:
Rob Pike 2012-02-27 16:23:22 +11:00
parent 2d6a6ed9fc
commit 28668c3a28

View File

@ -23,7 +23,7 @@ type InternalExample struct {
} }
func RunExamples(matchString func(pat, str string) (bool, error), examples []InternalExample) (ok bool) { 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. return // Don't run examples if testing is restricted: we're debugging.
} }
ok = true ok = true