commit | a4e9122f10c5ab41ebe4595674c7e2acb8737ac7 | [log] [tgz] |
---|---|---|
author | Rebecca Stambler <rstambler@golang.org> | Fri May 31 23:34:02 2019 -0400 |
committer | Rebecca Stambler <rstambler@golang.org> | Mon Jun 03 19:23:55 2019 +0000 |
tree | 8d7332b125897be645760c2ab073f60b425f7c54 | |
parent | 178e83bc9d6a1190667fd60e42deb7c461adabf2 [diff] |
internal/lsp: fix regression from CL 179439 Fixes golang/go#32378 Change-Id: I7c5b794ba6137084a56e3e7bf8027a6f65819b34 Reviewed-on: https://go-review.googlesource.com/c/tools/+/179919 Run-TryBot: Rebecca Stambler <rstambler@golang.org> Reviewed-by: Ian Cottrell <iancottrell@google.com>
diff --git a/internal/lsp/cache/pkg.go b/internal/lsp/cache/pkg.go index eeb1403..9cf86b4 100644 --- a/internal/lsp/cache/pkg.go +++ b/internal/lsp/cache/pkg.go
@@ -161,5 +161,9 @@ } func (pkg *pkg) GetImport(pkgPath string) source.Package { - return pkg.imports[pkgPath] + if imp := pkg.imports[pkgPath]; imp != nil { + return imp + } + // Don't return a nil pointer because that still satisfies the interface. + return nil }