delve
Delve is a debugger for the Go programming language.
Delve is a debugger built specifically for Go programs, letting you pause execution, step through code line by line, and inspect variables with proper support for goroutines and other Go-specific features.
Delve is a debugger specifically designed for the Go programming language. A debugger is a tool that lets you pause a running program, step through it line by line, inspect the values of variables at any point, and understand exactly what your code is doing — which is invaluable when something is not working as expected.
Delve was built from the ground up to understand Go's unique runtime characteristics, such as goroutines (Go's lightweight threads), defer statements, and closures. Generic debuggers designed for other languages often struggle with these Go-specific concepts, so Delve exists to fill that gap properly. The project's stated goal is to be simple to invoke and to stay out of your way — you are already dealing with a bug, so the last thing you need is a complicated tool.
You use Delve from the command line or through an editor plugin. Most major Go development environments — including VS Code, GoLand, and others — integrate with Delve under the hood when you click a debug button. You would reach for Delve directly when you need to debug a Go program, whether that is a web server, a command-line tool, or any other Go application. It is written in Go and licensed under the MIT license.
Where it fits
- Pause a running Go web server and inspect variable values at a specific line to find the source of a bug.
- Step through goroutines one at a time to debug a race condition or concurrency issue in Go code.
- Set breakpoints in VS Code or GoLand that use Delve under the hood when you click the debug button.
- Attach Delve to a running Go process in production to diagnose a live issue without restarting the server.