Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change default path to store executable in Go compiler?

Tags:

go

In Go compiler, when I do "go run", executable file is stored to a temporary location. How to change this path to store the file in current working directory? I am using windows 7 64bit machine.

like image 582
Cool Goose Avatar asked Sep 10 '25 10:09

Cool Goose


1 Answers

If you want to do something with the binary beyond just running it once, you should be using go build, not go run. go build will put the binary in the current working directory.

like image 124
Adrian Avatar answered Sep 13 '25 05:09

Adrian