x/tools/gopls: Cannot find method when using C structs #57781
Labels
FrozenDueToAge
gopls
Issues related to the Go language server, gopls.
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
Tools
This label describes issues relating to any tools in the x/tools repository.
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
Milestone
Hello!
gopls version
go env
What did you do?
The code below compiles and runs just fine.
However, gopls complains because it cannot find the "
show
method".$ ~/go/bin/gopls check main.go main.go:21:4-8: n.show undefined (type _Ctype_struct_number has no field or method show)
What did you expect to see?
I expected gopls to find all the references.
What did you see instead?
gopls did not find a reference to the
show
method, even though it is defined and found by the compiler.Editor and settings
Using it in the command line. Even though I do not report it here, the same error appears in VSCode, given that it uses gopls.
Thanks ;)
The text was updated successfully, but these errors were encountered: