Show test coverage
Generate HTML coverage report and open in browser
go test -coverprofile=cov.out ./... && go tool cover -html=cov.out
- tool
- go10 commands
More go commands
-
go get github.com/some/pkg@v1.2.3Download a specific module version and update go.mod
-
go mod tidyAdd missing and remove unused module dependencies
-
go mod vendorCopy all module dependencies into the vendor/ directory
-
go test -cpuprofile=cpu.prof -bench=. ./... && go tool pprof cpu.profRun benchmarks, collect CPU profile, open pprof interactive UI
-
go list ./...Print import paths of all packages in the module