为什么在IntelliJ Idea中找不到要去的声明?

I have a code in go, and I am using IntelliJIdea for development. It used to work fine, but since the time I have changed the folder where the code used to be, IntelliJ has been behaving in a weird manner. It shows me a lot of unable to find declaration to go to errors. After changing the folder where my project used to be, I changed the GOPATH and imported from the new directory once again.

I am attaching the screenshot as that will be better for understanding.

See the conductor.Start(). This function is right there in the package app. But it can't find this.

PS: I have tried importing the project from scratch and invalidating and restarting multiple times, but that didn't help.

I'm using Gogland, which is also a JetBrains IDE, but I also had a problem with symbols not getting resolved.

I fixed it by deleting the project's index file.

  1. Close the IDE.
  2. In your project directory, find a directory named ".idea".
  3. Delete all files with the extension ".iml" in that directory.
  4. Restart the IDE.

The project should get reindexed and symbols will be resolved.

https://www.jetbrains.org/intellij/sdk/docs/basics/project_structure.html?search=.iml