invalid go:embed: build system did not supply embed configuration #4984
-
| I upgraded Go to 1.23.0 and golangci-lint 1.60.3, I get the following error message with existing project: I used //go:embed directive in my programs. Is there a way to fix this issue or workaround this issue? I don't have this linting error when my project is using Go 1.22.4 and golangci-lint 1.56.2. | 
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
| Hello, this error is not new but I guess you have tried to skip/ignore it with an exclude rule. As explained inside the documentation, linters cannot perform the analysis when there are  
 The change inside v1.60.1 was to avoid side effects: most linters are not able to perform the analysis when there are  To be more explicit, before this change, most linters simply did not produce any reports because of the presence of  So  The only way to "fix" is to provide the file required by the embed directive. | 
Beta Was this translation helpful? Give feedback.
-
| Thank you for the quick response and https://golangci-lint.run/product/changelog/#v1601 is helpful. | 
Beta Was this translation helpful? Give feedback.
-
| I encountered this and found that it happens when the file I wanted to embed does not exist AND the  
 | 
Beta Was this translation helpful? Give feedback.
Hello, this error is not new but I guess you have tried to skip/ignore it with an exclude rule.
As explained inside the documentation, linters cannot perform the analysis when there are
typecheckerrors. This is not related to golangci-lint itself but to how the analysis system works inside Go tooling.typecheckerrors are reported in the same style as linter reports/issues but are completely different because they are related to compilation problems (typecheckis not a linter).The change inside v1.60.1 was to avoid side effects: most linters are not able to perform the analysis when there are
typecheckerrors, but some users thought it was working to just skiptypecheckerrors.To be mo…