How to change the default building directory (%TEMP%)

Hi there,

My antivirus at work keeps on flagging my Go program as malware. Unfortunately, it doesn’t allow wild card in the exclusion list (or I would add 'Temp\go-build*`). It would be risky to exclude the entirety of %TEMP%.

Is there a way to tell Go to build/compile in a user-specified folder, rather than %temp%?

(I’m obviously on Windows, or I wouldn’t be having these silly issues.)

Thank you,

Use gobuild instead of gorun.

thank you for your suggestion. go build still uses %TEMP%\go-build for building the executable unfortunately.

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