That's a question that goes hand in hand with this one here.
Difference: in the linked question I am using GoLand from within WSL (having Run Target set to its default which is "Local Machine") and in this question I am using GoLand from outside WSL (i.e. from the Windows host) using Run Target set to WSL2.
What I am struggeling with (since days now), is to debug go code using the IDE GoLand and using their feature of Run Targets, which is set to WSL 2.
My Go source files are on my Windows host system, the GO SDK is installed in both the Windows host and the WSL subsystem.
- Windows Host: Windows 10
- Inside WSL2: Ubuntu 20.04.03
- Go: 1.18.2
- GoLand: 2022.1
- Delve: 1.8.2
go build
, go run
and even go install
works fine, but debugging hangs shortly after the debugger started showing me this output:
That's my Go code:
This is my run/debug configuration:
And within the run/debug configuration, that's my target:
Note, that the debugger seems to be still up, since the process dlv is still there and I can cancel the debugging (it's just simply hanging without even starting the debugging):
And these are my Go environment variables:
I also found some discussions, which are maybe about the same subject, and I tried everything out that I could and found there, but without any luck. See:
https://youtrack.jetbrains.com/issue/GO-10846