http://stackoverflow.com/questions/16161142/how-to-test-only-one-benchmark-function
-test.bench pattern Run benchmarks matching the regular expression. By default, no benchmarks run. -test.run pattern Run only those tests and examples matching the regular expression.
For convenience, each of these
-test.X
flags of the test binary is also available as the flag-X
in 'go test
' itself.
For help,
$ go help testflag
For example,
go test -test.bench MapTravel
go test -test.bench MapGet
or
go test -bench MapTravel
go test -bench MapGet
To bypass test functions, use an improbable -test.run
pattern. For example,
go test -test.bench MapTravel -test.run XXX
or
go test -bench MapTravel -run XXX