This is a creation in Article, where the information may have evolved or changed.
Bash:go test-bench=. -test.benchmemgoos:darwingoarch:amd64pkg:benchmarkBenchmarkConcatString-4 10000000 169Ns/op530B/op0allocs/Opbenchmarkconcatbuffer-4 100000000 11.7Ns/op2B/op0allocs/Opbenchmarkconcatbuilder-4 100000000 13.1Ns/op2B/op0allocs/Oppassok Benchmark4.416s
Help
-Test.bench RegExp Run only benchmarks matching regexp-test.benchmem Print Memory Allocations forBenchmarks-Test.benchtime D run each benchmark forduration d (default 1s)-test.blockprofilefile WriteA goroutine blocking profile tofile-test.blockprofilerate rate Set blocking profiles rate (see runtime. setblockprofilerate) (Default1) -test.count N Run tests and benchmarks N times (default1) -test.coverprofilefile WriteA coverage profile tofile-test.cpu list Comma-separated list of CPUs counts to run all test with-test.cpuprofilefile WriteA CPU profile tofile-Test.failfast DoNot start new tests after the first test failure-test.list regexp list tests, examples, and benchmarks matching regexp ThenExit-test.memprofilefile WriteA memory profile tofile-test.memprofilerate rate Set memory profiling rate (see runtime. Memprofilerate)-test.mutexprofilestring WriteA mutex contention profile to the namedfileAfter execution-test.mutexprofilefractionint if>=0, calls runtime. Setmutexprofilefraction () (Default1) -test.outputdirdir WriteProfiles todir-test.parallel N Run at the most n testsinchParallel (default4) -Test.run RegExp Run only tests and examples matching regexp-test. Shortrun smaller test suite to save Time-test.testlogfilefile WriteTest action Log tofile( forUse only by cmd/go)-test.timeout D Panic Test binary after duration d (default0, timeout disabled)-test.tracefile WriteAn execution trace tofile-test.v verbose:print Additional output