Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
x/tools/gopls: import errors are not disappearing on first file of project #37195
When I create a new project, I run
then proceed to type
When I hit save, the
The error messages that keep coming up are: "getting file for AllImportsFixes: command-line-arguments has no metadata" and "diagnose: no workspace packages: command-line-arguments has no metadata".
This issue seems to be on go/packages/golist.go#L289 and seems to be caused from falling back to using an ad-hoc package is there is an error loading the package, I think the problem here is that if the file does not have a package line yet, then the package that gets returned from go/packages will be "command-line-arguments". gopls caches this package and attempts to keep loading this package on file changes and never gets any metadata back.