Pause and inspect a failing execution
#Delve is an optional Go debugger that can run a program or a test binary.
Shell with Delve installed: dlv test ./path/to/package. Set a breakpoint, continue, inspect stack/locals.
Reference
Choose TypeScript, Go, Rust or C++ and find syntax, everyday APIs, standard libraries and tools in one place.
TypeScript/Node, Go 1.23+, Rust 2024 and C++23: from a first CLI to files, JSON, HTTP, concurrency and testing. Complete programs are labeled; other examples identify their surrounding code/imports. Optional libraries and version requirements are named in each entry.
Delve is an optional Go debugger that can run a program or a test binary.
Shell with Delve installed: dlv test ./path/to/package. Set a breakpoint, continue, inspect stack/locals.
The race detector instruments supported executions. It finds races on executed paths, not all possible paths.
Shell: go test -race ./... on a supported platform/toolchain.
Use pprof/benchmarks to inspect allocation and retention; -race addresses a different class of problem.
Shell: go test -bench=. -benchmem. Profile a representative case rather than treating allocation count alone as correctness.
gofmt formats source; go vet checks selected suspicious constructs. Neither replaces behavioral tests.
Shell: gofmt -d ./example.go; go vet ./...
Record exact input, expected/observed behavior, version/configuration and a focused command. Reduce unrelated code while preserving the failure. Keep the result as a regression test once the cause is fixed.
Fragment