go test ./...
go test -race ./...
Race tests are slower and mostly supported on linux/amd64 in typical CI setups.
go test -cover ./...
go test -coverprofile=cover.out ./...
go tool cover -func=cover.out
Use one of:
//go:build integration)-short gateExample -short pattern:
if testing.Short() {
t.Skip("skipping integration tests")
}
Good for CLI output stability:
testdata/-update flag to refresh snapshots intentionallytime.Now injected) and randomness (seeded)