BitDefender detects output as a virus

I’m new to Go, but it doesn’t help when your anti virus detects the build output as a virus. Using the most basic “program” I get a virus warning:

The file C:\Users\MyUser\AppData\Local\Temp\go-build243796474\b001\exe\tempCodeRunnerFile.exe is infected with Gen:Variant.Bulz.245297. The threat has been successfully blocked, your device is safe

BitDefender have been looking into this for a while now and I haven’t had a solution to this. They’ve also said that I can’t cancel for a refund as I’ve had their AV for more than 30 days, although it isn’t exactly fit for purpose.

The most basic code is:

package main

func main() {

Can you add your temp folder to the whitelist? I had to do that with the built in Windows anit-virus.

I tried that, but because the folder name is random I’d have to exclude the whole \Local\Temp folder which would expose a lot of risks.
They also don’t allow wild card exclusions, so I can’t exclude \Local\Temp\go-build*

Howabout this:

good call - they mention about setting the GOCACHE variable, however setting the environment variable is GOCACHE=c:\go-cache, I still get the av picking it up in \local\temp\go-build

I’ll keep having a look.

go build main.go will produce the main.exe and that can be ran without the av complaining


sadly the same result

You have restarted after changing the environment variable or legged of at least to make sure all related programs pick it up correctly?

yeah - checked with go env, and even rebooted.

You my friend are a legend!!

Setting the GOTMPDIR to another path and excluding that path from the AV worked - after clearing all temp files on the PC.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.