Attempting to use Delve to debug Go, I get the following error:
could not launch process: fork/exec C:\code\go_stuff\debugtest\__debug_bin: Access is denied.
could not remove C:\code\go_stuff\debugtest\__debug_bin: remove C:\code\go_stuff\debugtest\__debug_bin: Access is denied.
This is on a very simple Go project I created using go mod init and I wrote the main.go using Vim, so no VSCode or anything else is involved.
I tried to run dlv debug from the terminal and I get the above output.
I also get the above output when I try and debug using Delve in VSCode as well.
I have tried this on another PC and it works perfectly so it may well be something environmental but I cannot fathom what is causing this.
None of the projects I am trying to debug are in git or indeed any other source control.
Before I incur any downvotes due to lack of code, here is my entire project:
package main
import "fmt"
func main() {
fmt.Println("So we begin")
fmt.Println("Here we end")
}
Actually I've met similar problem. I modify the "settings.json" file of VScode as following:
Then try to debug or either run without debug. It works and the "__debug_bin.exe" will not generate anymore. However I don't know the reason, it seems some problem of dlv configuration. Does anyone know the root cause? Hope this help you!