1

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

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
Mukhtar Bimurat
  • 356
  • 2
  • 18

3 Answers3

4

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.

dlsniper
  • 7,188
  • 1
  • 35
  • 44
0

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

Junaid
  • 3,477
  • 1
  • 24
  • 24
0

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

Sudipto
  • 299
  • 2
  • 11