go test builds and runs Go package tests, reports their results, and removes the compiled test binary afterward. It also supports benchmarks and profiling. section 1.7 section 2.3.2
Use go test to:
- Run package tests such as `go test ./url`. section 2.3.2
- Rerun tests with `-count=1` when cached results should be skipped. section 2.3.2
- Display individual test names and logs with `-v`. section 2.3.2
- Shuffle test order with `-shuffle=on`, then reproduce an order with its seed. section 2.3.2
Run a package test
From the Go module directory, run `go test ./url`. A passing run reports `PASS` and the package path; a repeated run may report `(cached)`. Add `-v` to inspect individual tests such as `TestParse` and `TestURLString`.
Figure 2.2 The go test tool and the testing package collaborate on running tests. Tests get a *T, which has methods for tests to call, log, report failures, and so on.
Shows how go test collaborates with the testing package: test functions receive *testing.T for logging and failure reporting. section 2.3



