Run tests with the race detector
Run all tests without cache and check them for data races
go test -race -count=1 ./...
- tool
- go10 commands
More go commands
-
go test -coverprofile=cov.out ./... && go tool cover -html=cov.outBuild an HTML coverage report and open it in the browser
-
go get github.com/some/pkg@v1.2.3Download a specific module version and update go.mod
-
go mod tidyAdd missing dependencies and remove unused ones
-
go mod vendorCopy all module dependencies into the vendor/ directory
-
go test -cpuprofile=cpu.prof -bench=. ./... && go tool pprof cpu.profRun benchmarks, collect a CPU profile and open it in interactive pprof