When I try to launch a Go Application
in debug mode, GoLand takes a considerable amount of time to launch it. This can take several minutes, and happens on each launch even if there has been no code change.
The problem is that GoLand forces a rebuild on each debug invocation. So if you have a lot of dependencies, it will be very slow.
The solution is to go in to Settings > Build, Execution, Deployment > Debugger
and disable Rebuild transitive packages
. This will speed up debug launches by 20x (90s vs 5s).
You should create a Go Application
target labeled "Complete rebuild" and set the Go Tool Arguments to be -i -a
. This will force a debug rebuild and store the intermediate products to speed up future builds.
However, this means your cached and optimized, thus without proper debugging information, packages can be used in the debugger which means that it will affect your debugging experience. If you have any issues with the debugger you will need to run with -a
first and see if the problem happens again.