go test
suggest changego test compiles packages whose names end in _test.go and runs functions named TestXxx, benchmarks named BenchmarkXxx, and examples named ExampleXxx. From the module or package directory:
go test
go test ./...
go test -run TestSum
./... tests the current package and its subpackages. -run takes a regular expression matched against the test name. See Basic Test for a minimal test file.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents