Replies: 3 comments
-
|
+1 |
Beta Was this translation helpful? Give feedback.
-
|
This is a known issue with how Here are a few things to check: 1. Make sure you have a Run this if you haven't already: go mod init your-module-nameWithout 2. Open VS Code at the correct root folder Open the folder that contains 3. Check your In {
"gopls": {
"analyses": {
"staticcheck": true
},
"directoryFilters": []
}
}4. If using a multi-folder workspace ( Each folder entry must point to the module root individually, otherwise gopls can lose track of sibling files in After making changes, run "Go: Restart Language Server" from the VS Code command palette ( Hope this helps! Let me know which step resolves it. 🙏 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Types and functions that exist in files of package main are not being recognized in main.go, so they flag as undefined warnings by the staticchecker(?!).
The app runs without issues, but it's annoying to see so many warnings that are false. One solution is place all code in the main.go file, but that is not great either.
Is there a way to fix this problem? I like having the staticchecker, but also want it to work properly.
Sam
Beta Was this translation helpful? Give feedback.
All reactions