x/tools/gopls: bad import causes test-exported values to be "not declared by package" #34012
Labels
FrozenDueToAge
gopls
Issues related to the Go language server, gopls.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
What did you do?
In a module
example.org/library
,library.go
:export_test.go
:library_test.go
:And open
library_test.go
.What did you expect to see?
flags
is not the correct name for theflag
package, and it correctly has an error saying "could not import flags". That is the only error.What did you see instead?
In addition to the error on
flags
and its usage,Offset
inlibrary.Offset(1)
has the error "Offset not declared by package library", which is not true. Removing the bad import or fixing it does not make theOffset
error go away; only a full reload does.Unfortunately, after "fixing it", gopls hangs (both master and 0.1.3), even the
gopls -rpc.trace -v check
is broken, even though the code was changed back to what was written above.master:
Build info
Built on master just to keep it recent, but happens on 0.1.3 and has on previous versions as well.
Go info
The text was updated successfully, but these errors were encountered: