gofmt非常慢完成。

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

gofmt extremely slow to complete

问题

我正在使用 iMac 27'' 2013 年底款型号,并且我想对我的软件包运行 gofmt 工具。

我这样调用它:

iMacs-Image:sergiotapia ~/smitego $ gofmt

然后它就一直卡在那里,永远不会完成。有什么建议吗?

英文:

I'm on an iMac 27'' late 2013 model and I want to run the gofmt tool against my package.

I'm calling it like so:

iMacs-Image:sergiotapia ~/smitego $ gofmt

And it's frozen there forever, never completing. Any suggestions?

答案1

得分: 14

你的调用方式不正确。gofmt 期望从标准输入接收源文件,并将格式化后的代码输出到标准输出。在要格式化的包所在的目录中使用 go fmt(中间有一个空格)来格式化包内的代码。

英文:

You're calling it incorrectly. gofmt expects a source file on its standard input and outputs formatted code on standard output. Use go fmt (with a space) inside the directory of the package you want to format to format the code inside a package.

huangapple
  • 本文由 发表于 2014年2月28日 01:58:11
  • 转载请务必保留本文链接:https://go.coder-hub.com/22076568.html
匿名

发表评论

匿名网友

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

确定