Hi relatively new to GO but a great enthousiast. I recently upgraded to v1.25 and using vscode for development. My big problem at the moment is that my windows Avira security software blocks everything when I do a “go run main.go” in vscode. I cant figure out how to configure in this security package on how to leave this specific situation alone. Problem is that go run builds something in a temporary generated directory and Avira quarantines it immediately. I am sure that this the problem because once I switch off realtime checking setting in Avira for 10 mins or so , everything works fine. I am sure I am not the first to run into this roadblock. Switching off Avira realtime checking makes me very uncomfortable and I did only by switching off internet access simultaneously but this only makes things a lot more unworkable of course .
Option1: Try use to code using WSL it is a Container Environment in Windows.
Option2: Go copiling the code in %TEMP% and Avira understand it is a strange action by a not assigned software. Change the default folder of Go editing Variables GOTMPDIR
set GOCACHE=C:\go-cache
set GOTMPDIR=C:\go-tmp
After add in Avira exception to ignore this folder. C:\go-cache e C:\go-tmp
Thanks Antonio, want to give option 2 a try. Will supply an update on my findings . A question upfront I do have is : I understand the two directories for building but once that is done wont it try to copy the main.exe (or whatever) to my go project dir which is different on every project and will block the copying of the file ?
did some work but it turned out to be a complete disaster changing my current “default” go env settings. After changing them (might have made a typo and so referring to a non existent dir) the entire go command was not available anymore, in vsc the language server crashed etc. Ultimately had to retract on everything and reinstall the go compiler. What I would like to do is not change anything there anymore but solely configure Avira folder exceptions list. Question then is how ? My current settings for the 3 ? paths involved are as follows:
GOPATH=C:\Users\Moniq\go
GOCACHE=C:\Users\Moniq\AppData\Local\go-build
GOTMPDIR=
If I select a dir in Avira for an exception I assume that it ignores this directory and everything below that?
In that case I need to block Avira for :
C:\Users\Moniq\go or possibly C:\Users\Moniq\go\src , since all my project code is contained in there (and main.exe is copied to a subdir of that GOPATH)
C:\Users\Moniq\AppData\Local\go-build where (in a generated subdir) the building of the executable is done before it tries to copy it to my project folder mentioned above