根據這篇文章,可以在 GoClipse 中啟用自動導入:1) install goimports:go get code.google.com/p/go.tools/cmd/goimports2) in eclipse goto: Preferences -> Go -> Go Formatter and set it to be the path of the goimports binThis will fix all imports when you format. If you combine this with #67, then imports will be automatically fixed on save.問題當我嘗試在 Eclipse 中搜索 Go Formatter 時,我找不到它。
1 回答

明月笑刀無情
TA貢獻1828條經驗 獲得超4個贊
我的眼睛注意到的一件事:
我知道 goimports URL 不再是 google.com/p/go.tools/cmd/goimports。
因此,讓我們嘗試以下操作:
執行
go get golang.org/x/tools/cmd/goimports
去
Preferences
->Go
設置
gofmt
為${GOPATH}/bin/goimports
(這是 goimports 所在的位置)重新啟動
Eclipse
,并確保它使用goimports
時CTRL+ SHIFT+F被按下。
- 1 回答
- 0 關注
- 200 瀏覽
添加回答
舉報
0/150
提交
取消