mirror of https://github.com/golang/go.git
Package loading (at least via go list) fails when the import header doesn't parse, so we need to invalidate metadata upon a state change from non parsing->parsing. Refactor metadata invalidation to implement this feature, add additional documentation, and avoid unnecessary work. This change revealed a latent bug (via TestDeleteDirectory): when statting a deleted directory failed, we could fail to invalidate any package IDs, even those we already knew about. This bug was masked by the somewhat complicated semantics of pkgNameChanged. The semantics of pkgNameChanged are simplified to encapsulate any change to a package->file association. Also refactor the parsing API somewhat, and add a bug report if we don't get a ParseGoFile while inspecting for metadata changes. Update most regtests to panic upon receiving bug reports. Fixes golang/go#52981 Change-Id: I1838963ecc9c01e316f887aa9d8f1260662281ab Reviewed-on: https://go-review.googlesource.com/c/tools/+/407501 Reviewed-by: Alan Donovan <adonovan@google.com> gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Robert Findley <rfindley@google.com> |
||
|---|---|---|
| .. | ||
| coverage | ||
| govulncheck | ||
| hooks | ||
| regtest | ||
| vulncheck | ||