1

According to this post autoimport could be enabled in 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.

Problem

When I try to search for Go Formatter in Eclipse I cannot find it.

enter image description here

4

1 回答 1

5

我的眼睛注意到的一件事:

我知道 goimports URL 不再是 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并确保它在按下+ +goimports时使用。CTRLSHIFTF
于 2015-11-29T22:34:38.567 回答