Since a few days, Goland is not recognizing files named "types.go" as go source files. This is just a problem for syntax highlighting, as the project still runs normally, but it's quite annoying, because it affects both files from my project and from the standard library.
Whenever I try to import the ignored file I get the error:
Build constraints exclude all the Go files in '/[REDACTED]/internal/api/types'
But the file just contains some types definitions, without any build constraint directive.
For example here is a file called types.go
And here the same file renamed
I already tried to invalidate caches, reinstall go and Goland but the problem still remains
CodePudding user response:
types.go
is recognized as a plain-text file for some reason. You can navigate to Preferences/Settings | Editor | File Types find File type auto-detected by content or Text and exclude types.go
from the patterns list.
Feel free to follow IDEA-258255 to make the process clearer.