debug – Access denied removing `__debug_bin` in Visual Studio Code


After debugging a go program, the __debug_bin file is leftover and is not getting removed, throwing an access denied error. I tried running VSCode with admin privileges but it’s the same.

I would like to get rid of this error if possible.
See here my simple setup:

enter image description here

launch.json:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch",
            "type": "go",
            "request": "launch",
            "mode": "auto",
            "program": "${fileDirname}",
            "env": {},
            "args": []
        }
    ]
}