Valid methods in being highlighted in red 'Unresolved Reference'

Possibly not valid for the original context, but the workaround I discovered is to rename the file where the method or other identifier is defined, allow Goland to reindex, and then rename it back to the original name.


Ran into this recently with a project in 'bitbucket.org' GOPATH not finding ones in 'github.com'. Checked the "Index entire GOPATH" box and it fixed it.

This option is present at: Files > Settings (Preferences) > Go > GOPATH


I had the same problem and this worked for me:

  1. From the main menu, select File | Invalidate Caches.

  2. In the Invalidate Caches dialogue, you can select additional actions that the IDE will perform while removing the cache files:

  3. Clear file system cache and Local History

  4. Click Invalidate and Restart.


The methods are defined in a big generated file that is not indexed by Gogland. To change the limit you should change idea.max.intellisense.filesize.

To do this, open custom properties file via Help | Edit Custom Properties menu and add something like this: idea.max.intellisense.filesize=4500 for 4.5 MB limit. The size is in Kilobytes.

Please use carefully, indexing large files may influence index update speed dramatically.