Go命令无限期挂起 [英] Go command hangs indefinitely
问题描述
当运行 go run ...
, go get ...
等时,该进程挂起并且永不返回.如果添加 -x
选项,我只会看到构建阶段,仅此而已.
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.
自从上次更新 go
以来,我已经使用了一点并且效果很好.系统重启后,它突然停止工作.
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.
在大多数情况下,如果 GOPATH
设置错误,您可能会收到某种错误消息,并且过程结束.我的问题是 GOPATH
设置为在启动时应已挂载的文件夹.不仅路径错误,而且驱动器安装失败.而这正是问题所在.由于某些原因,当 GOPATH
指向未安装的驱动器时,您将不会看到错误消息,并且该过程将永远挂起.
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.
这篇关于Go命令无限期挂起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!