doujiao7483
doujiao7483
2015-12-28 18:13

Intellij自动优化Go的导入

已采纳

I have Intellij ultimate version 14.1.4. How do I enable optimizing imports automatically with each save for "Go"?
In Settings->Editor->General->Auto Imports, I see options for Java/python/scala but not for Go. I have the Go plugin installed already. But this unused import compile error is a noise. I want to enable automatic optimizing of imports to avoid CTRL+ALT+O combination

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • dongping4273 dongping4273 5年前

    This functionality is not yet available for the Go plugin, that's why you don't see any options there / it doesn't work automatically.

    You might want to watch this issue or maybe this PR to get notified when they will be fixed.

    Meanwhile, you can use the Code -> Goimports file functionality and maybe assign it a shortcut of your own preference as it doesn't have one by default. For this to work you will need to have goimports installed and in your system's PATH.

    点赞 评论 复制链接分享