'GoLand could not find reference: " Unresolved reference 'NewRGBA' "

I am trying to do this sample, but GoLand could not find reference of NewRGBA function which is annoying, although it executes it correctly. I already tried this solution.

enter image description here



Solution 1:[1]

It seems that you accidentally marked the image.go file as plain text, which is why the IDE does not recognize anything defined in it correctly.

To fix this, go to Settings/Preferences | Editor | File Types and search in the file types list for Text. There you should see the list of all files/extensions marked as plain text. Remove image.go from the list and see if this works correctly. Additionally, make sure that file file is not listed in the Ignore files and folders input, in the same section.

Solution 2:[2]

I had a similar issue for gin.WrapH function utils.go. Tried the Override File Type option for utils.go in local module path which changed the file as a Go file but had a little cross sign where a tooltip marked that the file is excluded from compilation. The error Unresolved reference only went away when I selected the file, navigated to File -> File Properties -> Associate with File Type -> Register new file type association, and chose Go files

Solution 3:[3]

restoring the IDE setting solved the problem for me. I tried removing it from the text file association list but yet it wasn't solved

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 dlsniper
Solution 2
Solution 3 Sudipto