Closed connor-ve closed 2 months ago
Related Issues
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
Thanks for the report. Unfortunately...
All in all, I believe my code is getting flagged as malware but I am unsure how to fix this.
All you can do is report the issue to your antivirus vendor. This is not an issue in Go, so I'm closing here.
My company controls the windows defender settings, so I can't add exception on go.exe. I see go.exe is not signed. I guess the anti-malware protection is more suspicious on such executable and make deeper search. Could you try to sign installed binaries? (I think it's a good security practice in general.)
Go version
go1.21.4 windows/amd64
Output of
go env
in your module/workspace:What did you do?
To reproduce my error locally, all I need to do is run a go file using the command
go run { file name }
, and I will see a huge usage spike by my Antimalware executable on cpu usage. Then My code will proceed to "hang up" either before running or before exiting. Generally speaking after running for 30-40 second my code will complete running.What did you see happen?
For my environment I am running Windows 10 along with Windows Defender. Note I have not touched defender's settings since I got my laptop. Within the last month or so, I have noticed when I try to run my Go projects using the
go run
commands there is a long delay before my code actually runs and sometimes there is a long delay after the output of my code but it hasn't fully ended yet. In my code there are no go routines defined and I am working with fairly basic synchronous files and I have tested this with fairly small files. It is not consist with smaller go projects, (aka hello worlds), but with a a larger project it is every time. The big issue that I see is when I run my go command Antimalware Service Executable task will take up roughly 70% or more of my CPU. This causes my computer to freeze constantly and has been greatly hindered my progress. I have since tried to exclude the folder for my go projects from Windows Defender as this executable is specific to it, but I am still noticing the spike.What did you expect to see?
I expected my code to run fairly fast, and not to see a spike in the usage of my windows defender. All in all, I believe my code is getting flagged as malware but I am unsure how to fix this.