.exe vs running the main.go for webserver

I wrote a webserver to serve my website in localhost. I notice if I execute .exe file that the go compiler makes in windows it has the same effect as if I ran main.go which is the file that contains my main function call for the webserver. Is there any benefit to executing the .exe file over running the main.go file?

1 Like

The exe file can be used without having the source and a Go compiler installed. Using “go run” becomes cumbersome or impossible as your program grows (in number of files and packages). Apart from that, once it runs, it’s the same code no matter how you ran it.

5 Likes

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