[英]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.