GoLand debugger hangs: Delve session waits at 'API server listening' and does not start program
Problem
The debugger in GoLand 2026.2.3 on Windows 11 hangs after displaying API server listening at: 127.0.0.1:[port] when starting a debug session. The program does not start or produce further output, and the session appears unresponsive until the debugger is stopped. Running the program without debugging works as expected.
Cause [Optional]
The Windows environment has the environment variable GOARCH=386 set, causing GoLand to build 32-bit (windows/386) programs for every debug session. Delve, the debugger used by GoLand, supports only 64-bit (windows/amd64) programs on Windows. Delve is unable to find main.main in a 32-bit binary and waits at the API server stage. Stopping the debugger resumes the program, which then shows its output and exits.
Resolution
- Close GoLand.
- Open Edit the system environment variables in Windows.
- Click Environment Variables.
- Delete the
GOARCHvariable from both User variables and System variables, if present. - Open a new terminal window.
- Run
go env GOARCH GOHOSTARCHand confirm both values areamd64. - Start GoLand and debug the program again.
If GOHOSTARCH reports 386, the Go installation is 32-bit and not compatible with Delve on Windows. Download and install the 64-bit Go SDK (windows-amd64) and select it in GoLand.
For more information about Delve architecture support, see GO-3028.
Please sign in to leave a comment.