x/tools/gopls: weird files treated as packages #54815
Labels
gopls
Issues related to the Go language server, gopls.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
If one edits a random text file, say /tmp/foof, go/packages/golist.go treats it as a Go file. The comment at line 349 is
"// If we get nothing back from
go list
,// try to make this file into its own ad-hoc package.
// TODO(rstambler): Should this check against the original response?"
One would think it should look to see if there is a .go file involved somehow. Otherwise the gopls output is polluted by a lot of messages like
[Error - 10:22:27 AM] 2022/09/01 10:22:27 analyzer "tests" failed: analysis tests for package /tmp/foof panicked: runtime error: invalid memory address or nil pointer dereference
The text was updated successfully, but these errors were encountered: