When running go run ...
, go get ...
, etc., the process hangs and never returns. If I add the -x
option, I only see the build stage and nothing more.
Since the last update to go
, I've used it a bit and it worked fine. After a system restart, it suddenly stopped working.
It took me a bit to figure out what was going on and I thought I share the problem solution here, in case somebody else encounters the problem.
As it appears in most cases, if GOPATH
is set wrong, you'll likely get some kind of error message and the process ends. My problem was that GOPATH
was set to a folder that should have been mounted at boot up. Not only was the path incorrect, but also the mounting of the drive failed. And exactly that was the problem. For some reason, when GOPATH
points to an unmounted drive, you won't see an error message and the process hangs forever.
A solution that worked for me : If you are working with Visual Studio Code, remove the import section and press Ctrl+S, and let the imported files list get regenerated.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With