Valid methods in being highlighted in red 'Unresolved Reference'

前端 未结 4 1928
时光取名叫无心
时光取名叫无心 2021-02-20 06:39

How to solve this problem? The program works. But the methods in Gogland are highlighted in red. Qt version 5.8 is added.

Gogland (1.0 Preview) 1.0 EAP
Build #GO         


        
相关标签:
4条回答
  • 2021-02-20 06:48

    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.

    0 讨论(0)
  • 2021-02-20 06:49

    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.

    0 讨论(0)
  • 2021-02-20 06:52

    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

    0 讨论(0)
  • 2021-02-20 06:54

    This can also happen if go.mod is copied from another project without updating the project name:

    // go.mod
    
    module github.com/org/new-project
    
    go 1.15
    
    0 讨论(0)
提交回复
热议问题