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

  1. Close GoLand.
  2. Open Edit the system environment variables in Windows.
  3. Click Environment Variables.
  4. Delete the GOARCH variable from both User variables and System variables, if present.
  5. Open a new terminal window.
  6. Run go env GOARCH GOHOSTARCH and confirm both values are amd64.
  7. 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.

0 out of 0 found this helpful

Please sign in to leave a comment.

Have more questions?

Submit a request