I'm trying to setup a new Windows dev machine for Go and what is usually a pretty simple process has been met with a lot of headaches. When I try to run without debugging I get the following error:
fork/exec C:\Users\CAMIWIL\AppData\Local\Temp\go-build588834862\b001\exe\hello.exe: Access is denied. Process exiting with code: 1 signal: false
Likewise when I try to run with debugging I get:
could not launch process: fork/exec c:\dev\hello__debug_bin: Access is denied. Process exiting with code: 1
What's interesting is in the second case, if I run dlv manually on my code using a git bash it has no issues creating the __debug_bin file and I can debug to my hearts content. Likewise I can also build the code using command line as well. I also tried installing goland just to see if it had any issues, and that also seems to be working fine. I'm basically using VScode as is, I've only installed it along with the go extension at this point.
Anyone have any clue one what might be the cause of this? And what the resolution may be?
In my case I had to add an exclusion to my antivirus software to C:\Users\CAMIWIL\AppData\Local\Temp. After this step, I was able to run the go program without problems.