Go
Test Commands
Write and run tests, benchmarks, and fuzzing with Go's built-in testing framework. No external testing libraries needed — Go's standard library has everything for comprehensive testing.
13 commands
Pro Tips
Run 'go test -v -run TestSpecific ./...' to run a specific test with verbose output across all packages.
Use 'go test -bench=. -benchmem' to run benchmarks with memory allocation stats.
Generate coverage: 'go test -coverprofile=coverage.out ./... && go tool cover -html=coverage.out'.
Common Mistakes
Test results are cached. Use 'go test -count=1' to force re-execution when debugging flaky tests.
Tests in the same package run sequentially by default. Use 't.Parallel()' for concurrent tests, but watch for shared state.