I have a Visual Studio Code environment with the Linux Subsystem for windows running and it's compiling and running a Go project just fine.
Now I'm trying to get the delve debugger running following this link:
https://github.com/Microsoft/vscode-go/wiki/Debugging-Go-code-using-VS-Code
But I can't get it running, neither remote nor local.
Tried all kind of configurations in launch.json but breakpoints just arent hit and no error message is printed.
Has anyone got go debugging running on VSCode using the WSL?
Debugging in WSL# Once you've opened a folder in WSL, you can use VS Code's debugger in the same way you would when running the application locally. For example, if you select a launch configuration in launch.json and start debugging (F5), the application will start on remote host and attach the debugger to it.
To get started with using WSL in VS Code, you'll need to download the WSL extension from the Extension Marketplace. You'll also need WSL and a Linux distribution installed. We recommend using WSL 2, which is the newest version of WSL, as you will benefit from significant performance advantages over WSL 1.
Old post, but its not possible to get delve to work on WSL
https://github.com/go-delve/delve/issues/1235
There was a better resource that explains fully why it doesnt work, cant find it now
Apparently it has something to do with WSL not implementing Linux fully...but it will in WSL2!
https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With