Golang: 运行测试时出错:信号:被终止

huangapple go评论77阅读模式
英文:

Golang: Error while make test: signal: killed

问题

我在运行一个 Golang 项目的 make test 时遇到了以下错误:

signal: killed
FAIL <package name>
make: *** [test] Error 1

同样的代码在昨天之前都能正常运行。
注意:我也尝试在其他分支上运行 make test,但结果相同。

英文:

I am getting this error while running make test on a Golang project:

signal: killed
FAIL &lt;package name&gt;
make: *** [test] Error 1

The same code was running perfectly fine until yesterday.
Note: I tried doing make test on other branches also but same result.

答案1

得分: 8

更新于2017年4月27日:

新的Go1.8.1版本(发布于2017年4月7日)修复了这个问题。请下载并安装最新版本。

旧回答:

主要原因是命令行工具8.3不兼容。

根据https://github.com/golang/go/issues/19734中的解决方案:

  • 首先删除/Library/Developer/CommandLineTools,然后从https://developer.apple.com/download/more/?name=Xcode下载并安装命令行工具8.2

或者

  • 在编译或运行时使用-ldflags -s选项
英文:

UPDATE on 04/27/2017:

The new Go1.8.1 (released 2017/04/07) fixed this issue. Please download and install the latest version.

OLD ANSWER:

Mainly the reason was that Command Line Tool 8.3 is not compatible.

According to the solutions from https://github.com/golang/go/issues/19734:

OR

  • use -ldflags -s option for compilation or run

答案2

得分: 0

非常感谢 @JimB

我卸载了Xcode,现在它运行得很好。真奇怪!

英文:

Thanks a lot @JimB

I uninstalled the Xcode and it runs fine now. Weird !

huangapple
  • 本文由 发表于 2017年3月30日 01:21:35
  • 转载请务必保留本文链接:https://go.coder-hub.com/43100127.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定