diff --git a/gopls/internal/cache/testfuncs/tests.go b/gopls/internal/cache/testfuncs/tests.go index cfc7daab15c..fca25e5db19 100644 --- a/gopls/internal/cache/testfuncs/tests.go +++ b/gopls/internal/cache/testfuncs/tests.go @@ -281,7 +281,7 @@ func testKind(sig *types.Signature) (*types.TypeName, bool) { } named, ok := ptr.Elem().(*types.Named) - if !ok || named.Obj().Pkg().Path() != "testing" { + if !ok || named.Obj().Pkg() == nil || named.Obj().Pkg().Path() != "testing" { return nil, false } diff --git a/gopls/internal/test/integration/workspace/packages_test.go b/gopls/internal/test/integration/workspace/packages_test.go index 106734a1864..7ee19bcca54 100644 --- a/gopls/internal/test/integration/workspace/packages_test.go +++ b/gopls/internal/test/integration/workspace/packages_test.go @@ -124,6 +124,7 @@ func TestFoo2(t *testing.T) package foo import "testing" func TestFoo(t *testing.T) +func Issue70927(*error) -- foo2_test.go -- package foo_test