Debugging Go Applications in GoLand Using the Integrated Delve Debugger
Learn how to configure GoLand's built-in Delve debugger, set breakpoints, inspect variables, and avoid common pitfalls when debugging Go applications.
18 Apr 2026, 13:17 UTC

Quick answer
In GoLand you can start a debugging session by creating a Go Application run/debug configuration, setting breakpoints, and clicking the Debug button. The IDE launches Delve, stops at breakpoints, and lets you inspect variables, evaluate expressions, and view goroutine stacks.
Worked example: configuring and launching a debug session
- Open
Run → Edit Configurations…. - Click the
+button and chooseGo Application. - Set
Nametodebug-myapp. - In
Package pathbrowse to the directory containing yourmain.go(or type the module path, e.g.,example.com/myapp/cmd). - Ensure
Buildis checked so GoLand compiles before launching. - Optionally add program arguments in
Program argumentsor environment variables viaEnvironment variables. - Click
ApplyandOK. - Open
main.go, click in the gutter to set a breakpoint (red dot). - Press the
Debugtoolbar button (orShift+F9).
GoLand builds the binary, starts Delve, and opens the Debug tool window. The thread list shows the main goroutine stopped at the breakpoint. In the Frames pane you can expand variables, and the Watches pane lets you add expressions like len(slice) or err != nil. The Evaluate Expression dialog (Alt+F8) lets you test arbitrary Go expressions in the current scope.
Limits and common mistakes
- Delve version mismatch – GoLand bundles a Delve binary; if you manually change the Go SDK (e.g., to a newer Go version) without updating the bundled Delve, breakpoints may be ignored. Fix: open
Settings → Go → Debuggerand clickUpdateto match the SDK. - Remote debugging requires identical source layout and binary on the host. If you build locally and copy a different binary to the remote machine, Delve reports failed to find process. Ensure the remote build uses the same Go version and source tree.
- Complex conditional breakpoints (e.g., involving function calls or loops) can drastically slow execution because Delve re‑evaluates the condition on every step. Keep conditions simple or replace them with logging.
- When using Go modules, forgetting to set the correct GOROOT in
Settings → Go → GOROOTcan cause the IDE to use the wrong standard library, leading to cannot find package errors during build. - Neglecting to enable the
Buildoption forces GoLand to launch an outdated binary; changes to source code are not reflected, making breakpoints appear on wrong lines.
Verification checklist
- After starting a debug session, the
Debugtool window should show a thread in Stopped state and theFramespane should list the current file and line. - Hover over a variable in the editor or check the
Variablespane to see its runtime value. - Open
Help → About → Plugins → GoLand → Go debuggerto confirm the Delve version matches the one shown underSettings → Go → Debugger. - Toggle a conditional breakpoint with a simple expression (e.g.,
i == 5) and verify execution stops only when the condition holds.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.