dongweihuan8832
dongweihuan8832
2017-10-10 04:34

Intellij Go导入自动完成

已采纳

Anyway to have Intellij autocomplete import statements for github projects?

Like if I want to import github.com/gorilla/mux but I haven't run go get ... yet, is there anyway to have that be autocompleted?

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

1条回答

  • duanmao2650 duanmao2650 4年前

    but I haven't run go get ... yet, is there anyway to have that be autocompleted?

    No: Gogland should add the import automatically on save, but only if the package was installed first (present in a pkg folder of your workspace, for external packages)

    And even in that case, Gogland will not automatically import ambiguous packages (meaning if you have two rand packages, it will ask you which one to use, the crypto/rand or the math/rand). That should not be the case here.

    点赞 评论 复制链接分享