How to tell intellij to import my golang 1.11 modules defined in the go.mod file?

Completed

what i did:
* cloned the module to $GOPATH/src/<repo-ns>/<group-ns>/project-name in a terminal

* ``ìdea .```

* built it and ran debug

* debugging into the module at ../pkg/mod/... works fine

* "go get..." from the context menu doesn't help

IntelliJ IDEA 2018.2.3 (Ultimate Edition)
Build #IU-182.4323.46, built on September 3, 2018
Licensed to ...
Subscription is active until ...
JRE: 1.8.0_152-release-1248-b8 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.14

pictures:

and:

0
6 comments

sorry. restarting did solve the issue. please close.

0

Likely, the right thing to do was enabling Go modules support in `Settings | Go | Go modules`

5
Avatar
Permanently deleted user

I'm having this issue but a restart hasn't resolved it. I can build the code just fine (using go modules) so my computer has the toolchain... Everyone says in Preferences => go there should be something for go modules, but there isn't for me. I have intellij ultimate.

 

What am I missing?

0

For IntelliJ IDEA Ultimate this setting is under ` Settings/Preferences | Languages & Frameworks | Go | Go Modules (vgo) `

1
Avatar
Permanently deleted user

The only options under Go for me are "GOROOT", "GOPATH", "Vendoring and Build Tags", "Imports", and "On Save".

 

There is no "Go Modules (vgo)". I have the latest version of intellij ultimate, and the goland plugin installed through the "jetbrains plugins" section of the plugin manager.

I have noticed that the version of the go plugin is about a year older than the latest version according to this page: https://plugins.jetbrains.com/plugin/9568-go

 

But if I download the plugin's zip and try to install from disk, it errors out saying the plugin isn't supported in my version of intellij.

0
Avatar
Permanently deleted user

Figured the issue out: I had an old version of Intellij, but when I clicked "check for updates" in the menu, it told me I was up to date. Once I updated intellij, it said I had updates to the go plugin. Once installed, go modules showed up.

0

Please sign in to leave a comment.