【发布时间】:2015-12-02 18:11:10
【问题描述】:
根据this post可以在GoClipse中启用自动导入:
1) install goimports: go get code.google.com/p/go.tools/cmd/goimports 2) in eclipse goto: Preferences -> Go -> Go Formatter and set it to be the path of the goimports bin This will fix all imports when you format. If you combine this with #67, then imports will be automatically fixed on save.
问题
当我尝试在 Eclipse 中搜索 Go Formatter 时,我找不到它。
【问题讨论】:
-
也许,它是 gofmt。尝试将 gofmt 路径更改为 goimports 路径。
-
我已经运行 get 命令来获取导入代码,但我找不到二进制文件。我期待这与 gocode 相同。运行 get 命令后,gocode 二进制文件驻留在 eclipse 工作区的 bin 目录中,但这对于 goimports 的工作方式不同?
-
嗨@Alfred。想知道你是否解决了。如果没有,我的回答对你有帮助吗?谢谢。
-
@bshuster13 现在可以了。谢谢你。也许您可以将 ctrl shift f 添加到您的答案中。
-
@Alfred 干得好!谢谢你。
标签: eclipse go import goclipse