Nishant Roy
Nishant Roy

Reputation: 1141

Intellij go import autocomplete

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?

Upvotes: 1

Views: 197

Answers (1)

VonC
VonC

Reputation: 1324168

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.

Upvotes: 3

Related Questions