Reputation: 33
When press the Run button in GoLand, it will recompile the code even without any change for the code, why?
Upvotes: 0
Views: 513
Reputation: 7477
This is done by the Go compiler and it should be very fast if nothing changed, thanks to the compiler cache introduced in Go 1.10.
And the reason the recompilation step is required is simple: there is no simple way to tell if indeed nothing has changed or not in the build as external resources outside of the compilers reach could affect the results.
So, the IDE invokes the compiler first, then it starts the debugging process.
A better question would be: what are you trying to do and why is the recompilation a problem in this case?
Upvotes: 1