繁体   English   中英

如何在GoClipse中启用自动导入?

[英]How to enable autoimport in GoClipse?

根据这篇文章,可以在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时,找不到它。

在此处输入图片说明

我的眼睛引起注意的一件事:

我知道goimports网址不再是google.com/p/go.tools/cmd/goimports。

因此,请尝试以下操作:

  1. 执行go get golang.org/x/tools/cmd/goimports
  2. 转到Preferences -> Go
  3. gofmt设置为${GOPATH}/bin/goimports (goimports所在的位置)
  4. 重新启动Eclipse并确保在按下CTRL + SHIFT + F时使用goimports

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM