Slow go tools in command line

Hello there, it’s my first post, and I’m learning go in the hope of doing cool stuff :slight_smile:

I have setup a development environment as described in the documentation, and I have been able to compile and run various little programs, with go build, go run, go install etc.

My problem is the invocation of those go command: sometime they are really slow, and they hang for ~10 seconds.

I’m on windows 10 with a good computer (i7, 8go ram), I use the good old “cmd.exe” and my go version is “go1.10.1 windows/amd64”

I tried to add D:/Go and D:/GoWorkspace (I guess the names are self-explanatory) to my antivirus, but it didn’t change anything.

Also, the strangest part is this: I installed a sublime package to build inside my text editor. Its working quite well and fast, and repeatedly build my little program under 1 sec.

Any help is really appreciated :slight_smile:

PS: so Go is really C 2.0… I need to practice more to decide if I like it ^^

Step zero: disable antivirus, see if that makes a difference.


This is definitively my antivirus (Avira Antivirus). It turned OFF the “real time protection”, and the go commands worked like a charm :slight_smile:

Obviously I want to keep my antivirus turned ON, so I need to tell him “don’t worry, go is fine”.

When I run go with the -x command, it gives me some extra informations:

go run -x hello.go

Do I have any control over this WORK variable ? I could set it to D:\GoWork, and add a clean exception to my antivirus (I don’t want to add C:\Users\cleme\AppData\Local\Temp to the exception list).

I do realize that it’s not really a go question (more of an antivirus configuration), but if you have any ideas, it would be great :wink:

EDIT: maybe this WORK variable isn’t the solution…

See go help environment. You probably want to be changing GOTMPDIR and/or GOCACHE to directories your antivirus will leave alone.

Delete disk partition and install Linux :smile:

Hey !

It worked thank you a lot :slight_smile:

@Acim: Come on ! Everybody knows that Windows > Linux :wink:

1 Like

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