mirror of https://github.com/golang/go.git
This change simplifies the two functions called KnownPackages, and renames one of them. The first, source.KnownPackages, is a standalone function called in exactly one place: ListKnownPackages. It has been renamed KnownPackagePaths to distinguish from the other and to make clear that it returns only metadata. Its implementation could be greatly simplified in a follow-up, as noted. In the meantime, one obviously wrong use of ImportSpec.Path.Value (a quoted string literal!) as an package (not import!) path was fixed, and the package name was obtained directly, not via CompiledGoFiles. The second, Snapshot.KnownPackagePaths, is called from two places. This CL eliminates one of them: stubMethods used it apparently only to populate a field of missingInterface (pkg) that was unused. The other call (from 'implementations') is something that should eventually go away as we incrementalize; in any case it doesn't rely on the undocumented ordering invariant established by the implementation. This change removes the ordering invariant, documents the lack of order, and removes the ordering logic. Change-Id: Ia515a62c2d78276b3344f2880c22746b2c06ff64 Reviewed-on: https://go-review.googlesource.com/c/tools/+/451675 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Alan Donovan <adonovan@google.com> gopls-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Robert Findley <rfindley@google.com> |
||
|---|---|---|
| .. | ||
| coverage | ||
| govulncheck | ||
| hooks | ||
| lsp | ||
| regtest | ||
| robustio | ||
| span | ||
| vulncheck | ||
| migrate.sh | ||