Hi,
Can anyone advise if it is possible to, when running go code with “go run hello-world.go” to tell Go where to place and run the compiled .exe from? I am being asked not to use the C:Win\tmp folder as it is to be scanned and .exe’s blocked from running there in the next version of our corporate a/v product.
I can run a go build and get the .exe then run it, but that’s a messy and slow workflow.
Hi,
hmm, I would suggest to run something like this go build <file> -o c:\path\to\my\binary && c:\path\to\my\binary . Not sure if this is an option for you.
Many thanks. Will get it a try. I had considered writing a little app which would call go build on the current buffer, send the output to a discrete place then run it. Which more or less is, I think, what your suggestion would do?
Before going there I just wanted to be sure that there was no easy way to change the default output of go run
Yeah I think it does exactly the same. In general I would suggest to use build “way” since run approach can be complicated when your app will get bigger (more files, tests ect)