Skip to content
cheatsheet
home
/
cv
/
weblog
/
cheatsheet
/
proxy
/
vpn
/
status
/
links
EN
RU
☾
New version available
reload
×
cheatsheet
/
go
/
Run tests with race detector
Run tests with race detector
go
Run all tests with race condition detection enabled
go test -race -count=1 ./...
⎘ copy
#go
#debug
more go
all 10 commands →
Show test coverage
go test -coverprofile=cov.out ./... && go tool cover -html=cov.out
Add a dependency
go get github.com/some/pkg@v1.2.3
Tidy up module dependencies
go mod tidy
Vendor dependencies
go mod vendor
CPU profiling
go test -cpuprofile=cpu.prof -bench=. ./... && go tool pprof cpu.prof