Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Valid methods in being highlighted in red 'Unresolved Reference'

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-171.4694.61, built on June 27, 2017
Gogland EAP User
Expiration date: September 25, 2017
JRE: 1.8.0_112-release-736-b21 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.8.0-58-generic


batis@dev:~$ printenv | grep GO
GOROOT=/usr/lib/go-1.8/
GOPATH=/home/batis/gocode/

package main

import (
    "os"
    "github.com/therecipe/qt/widgets"
)

func main() {
    widgets.NewQApplication(len(os.Args), os.Args)

    //create a window
    window := widgets.NewQMainWindow(nil, 0)

    ......

    widgets.QApplication_Exec()
}

Some image

GOPATH

Some image

Test run OK!

like image 759
Sergey Andrianov Avatar asked Jul 05 '17 09:07

Sergey Andrianov


2 Answers

For me, none of the above solutions worked. Finally I could solve it by enabling "Enable Go Modules Integration" checkbox located under Preferences > Go > Go Modules.

like image 188
emreoktem Avatar answered Oct 14 '22 02:10

emreoktem


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.

like image 25
Alexander Zolotov Avatar answered Oct 14 '22 03:10

Alexander Zolotov