I want to debug GoLang on VSCode editor. In their documentation they say it is possible. I am following the following Link to install the debugging features on the IDE. https://marketplace.visualstudio.com/items?itemName=lukehoban.Go
And to install Delve they ask to follow these instructions https://github.com/derekparker/delve/blob/master/Documentation/installation/windows/install.md
Once installation is completed they ask to run the following code
$ mingw32-make install
But there is an error
mingw32-make: *** No rule to make target 'install'. Stop.
Does anybody know whats wrong with this? Has anything changed other than these instructions?
Debugging your ApplicationAdd a breakpoint at line 10 of our main.go file by running breakpoint main.go:10 (or b main.go:10 for short). Run continue (or c ) to run-to-breakpoint.
To debug a program, execute the dlv debug command. Attach the filename at the end of this command, and debugging will start. For example, if you want to debug the main.go file, run the command dlv debug main.go . It is also known as “delve server” because this is a running process waiting for instructions.
Launch configurations. To run or debug a simple app in VS Code, select Run and Debug on the Debug start view or press F5 and VS Code will try to run your currently active file.
I managed to get this resolved. You don't want to install mingw for this. Instead run this code and make sure the dlv.exe which is created in any directory which is in your PATH variable in your computer.
$go get -u github.com/derekparker/delve/cmd/dlv
I also did an writeup about debugging Golang using VSCode and Delve. If you are interested you can read it here.
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