[英]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。
因此,请尝试以下操作:
go get golang.org/x/tools/cmd/goimports
Preferences
-> Go
gofmt
设置为${GOPATH}/bin/goimports
(goimports所在的位置) Eclipse
并确保在按下CTRL + SHIFT + F时使用goimports
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.