Setting for build not to use temp directory
GOROOT=D:\Users\xxx\Outils\Golang #gosetup
GOPATH=D:\Users\xxx\Workspace\go #gosetup
D:\Users\xxx\Outils\Golang\bin\go.exe build -o D:\Users\t0120397\AppData\Local\Temp\___go_build_main_go.exe D:/Users/t0120397/MyApp/Workspace/go/src/gimap/main.go #gosetup
D:\Users\xxx\JetBrains\Goland\bin\runnerw.exe D:\Users\t0120397\AppData\Local\Temp\___go_build_main_go.exe #gosetup
runnerw.exe: CreateProcess failed with error 1260: Ce programme est bloqu� par une strat�gie de groupe. Pour plus d
Process finished with exit code 1260
Hi,
Corporate policy mandates a whitelist of directories that can contain executables. Temp directory can't be one.
Either Golang home directory, GOPATH, GOROOT or project root could work. Is there a setting to override the setting ?
Regards
Please sign in to leave a comment.
Hi Jean,
You can tell the IDE to create the executables in any directory you want by changing the "Output Directory" option in the currently active "Run Configuration" via "Run | Edit Configurations... | Go Build | <name of the configuration> | Output Directory".
If you wish to make this setting default for all new run configurations created in the current project, you can go to "Run | Edit Configurations... | Templates | Go Build | Output Directory" and change the value there to point it to the current project directory or any other directory which is allowed.
I do not recommend placing binaries inside GOROOT or "Golang home directory".
Kind regards,
Florin
Thanks, that solves my problem.
Does not work as desired for me.
Unfortunately the executable name is taken from the configuration name, if not specified in the "Go tools arguments"
I want to be able to specify both the executable name (independent of the conf name) and the output folder.
You can specify a full path to the executable in the "Go tools arguments": -o /path/to/bin
Yes. I know that but then the "Name of the Output Directory" becomes irrelevant.
So does it handle your case?
Yes, but I was looking for a more elegant solution.
In a good IDE, you would not need to set command line arguments.
Just a suggestion for future releases.