关于goland:如何更改GO文件的默认输出文件夹路径?

How can I change the default output folder path of the GO file?

因为我已经在计算机上安装了Avira,所以一旦在GoLand中运行go文件,Avira就会提示我" BLOCK HEUR / APC(could)........."安全警告。

同时,GoLand还表明

Error running 'go build test.go': Cannot run program"C:\\Users\\Simon\\AppData\\Local\\Temp___2go_build_test_go.exe" (in directory"E:\\Application software\\GO\\awesomeProject"): CreateProcess error=5, ACCESS DENIED.

我想知道如何将默认输出路径(即build -o" path")更改为另一个路径; 毕竟,我不想每次都关闭Avira的实时保护," C"盘也是一个敏感区域。 我应该配置GO来源的设置还是仅更改GoLand中的某些设置? B.W.W,除非有必要,否则我不想更改Avira的设置:)

预先感谢,我是Go语言的初学者。


您可以通过Run | Edit Configurations...编辑运行配置,并将Output directory设置为所需的任何位置,请参见下面的屏幕截图。

outpud directory in a run configuration

如果要为项目的所有新运行配置设置此设置,请转到Run | Edit Configurations... | Templates | Go Build,然后在此处配置Output directory设置。 然后,所有新的Go Build配置将使用该设置。