Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

goland on windows not recognizing imports and throw error

i have enabled the go modules integration according to this docs .
https://www.jetbrains.com/help/go/create-a-project-with-go-modules-integration.html#enable-go-modules-in-a-project
but yet again as you can see in image below . goland keep throwing error on some code i have
enter image description here

as you can see in image i have that execlise package but it keep giving error . not only that i have some error on other files
enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

That happens sometimes with IDEs, from my experience it may happen because of at least three reasons.

first: the differences between package versions in your go.sum, you should empty the go.sum and run go mod tidy command.

Second: the version you’re using is older or newer than what you’re expecting, so the package does not support these methods or didn’t include them. so you should set the exact version of the package. (I suggest you read the documentation of the package in this case)

Third: your IDE has got some problems with the caches. for solving this: you should click on file -> invalidate caches to rebuild your IDE caches.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading