Skip to content

Guide · Open source

How to use Delve: install and debug Go programs

Updated · written with AI from the project's own documentation and checked against our catalogue data

Delve is an open-source, MIT-licensed debugger for programs written in Go. A debugger lets you pause a running program, inspect its variables and step through its code line by line to find bugs. This guide explains what Delve is for, how to get it set up, and how to start using it.

Delvego-delve/delve · ★ 25k · MIT

Quick start

  1. 1Install the Go toolchain. Delve is built for Go, so you need a working Go toolchain. The README does not specify a version, so check the installation docs.
  2. 2Get Delve. Follow the installation page linked from the README. To fetch the source, run git clone https://github.com/go-delve/delve.
  3. 3Read the Getting Started guide. Open Documentation/cli/getting_started.md to learn how a first debug session works.
  4. 4Pause and inspect your program. Use the command line client to pause the program and look at its variables.
  5. 5Step through the code. Move through your code line by line to find where behaviour diverges from what you expect.
  6. 6Connect your editor (optional). If you work in an editor or IDE, check Documentation/EditorIntegration.md for supported integrations.

What is Delve and who is it for?

Delve is a debugger for the Go programming language. Its stated goal is to be a simple, full-featured debugging tool for Go that is easy to invoke and easy to use. The project's README adds that because people reach for a debugger when things aren't going their way, Delve should stay out of your way as much as possible.

  • Go developers who need to find bugs by stepping through code
  • People debugging Go programs from the command line
  • Developers using an editor or IDE that integrates with Delve

Install Delve and the Go toolchain

Delve requires the Go toolchain. The provided README does not state which Go version is needed, so check the project's installation documentation for that. The README's installation section links to a Documentation/installation page for the official install steps.

The README's command for getting the source is shown below. It clones the repository from GitHub.

  • Install the Go toolchain first
  • Clone the repository if you want the source
git clone https://github.com/go-delve/delve

Start debugging with the command line client

Delve includes a command line client. The README points to a Getting Started guide and a command line client reference for the full list of commands and options. Read those pages for the exact commands to start a debug session, set breakpoints and step through code.

Once you are in a session, the core tasks are the ones the README describes: pause a running program, inspect its variables, and step through its code line by line.

  • Getting Started guide: Documentation/cli/getting_started.md
  • Command line client reference: Documentation/cli/README.md
  • Command line options: Documentation/usage/dlv.md

Use Delve with your editor or a GUI

Delve can be used without a graphical interface, but many developers reach it through an editor or IDE. The README links to editor integration documentation under Plugins and GUIs. The README mentions that GUIs exist, but the provided text does not describe them, so check that page for the current options.

Among comparable tools the project lists gdb, the Visual Studio Code Go debugger and the GoLand debugger.

  • Editor integration docs: Documentation/EditorIntegration.md

Find answers and report problems

The README asks that the GitHub issue tracker be used only for bugs. Feature proposals and general discussion go to the developer mailing list. The project also has a Frequently Asked Questions page for common issues.

  • Bugs: the GitHub issue tracker
  • Feature proposals and discussion: the developer mailing list
  • Common questions: Documentation/faq.md

What people use it for

  • Pausing a Go program to check the values of variables at a point where a bug appears
  • Stepping through Go code line by line to find where results go wrong
  • Debugging a Go program from the command line
  • Using an editor or IDE that integrates with Delve to set breakpoints and step through code

Frequently asked questions

What is Delve used for?

Delve is a debugger for programs written in Go. It lets you pause a running program, inspect its variables and step through its code line by line to find bugs.

Is Delve free to use?

Delve is released under the MIT licence, as shown in the project's README and its LICENSE file. Check the LICENSE file for the full terms.

What do I need to install Delve?

You need the Go toolchain. The README does not state a required Go version, so check the project's installation documentation.

Can Delve debug programs written in other languages?

No. Delve only debugs Go programs. For other languages, look at a debugger built for that language.

Is there a graphical version of Delve?

The README says GUIs exist, but the provided text does not detail them. Editor integrations that run Delve underneath are listed in Documentation/EditorIntegration.md.

How is Delve different from gdb?

Delve is built specifically for Go and aims to be easy to invoke and use. gdb is a general-purpose debugger that the project lists as a comparable tool. Pick based on whether you mainly debug Go code.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Delve is a good choice for Go developers who want a debugger built for Go that is simple to start and stays out of the way. If you work in other languages, or you want a graphical debugger as your main interface and your editor does not provide one on top of Delve, consider a tool such as gdb or your IDE's own debugger.

Install options & downloads