go/packages: doc: type symbols are consistent only within one Load
Updates golang/go#66690
Change-Id: I26199c39434ab83c1a25756bd5f135a0ea785fad
Reviewed-on: https://go-review.googlesource.com/c/tools/+/577256
Auto-Submit: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
diff --git a/go/packages/packages.go b/go/packages/packages.go
index 865d905..b627a95 100644
--- a/go/packages/packages.go
+++ b/go/packages/packages.go
@@ -428,6 +428,10 @@
// The NeedTypes LoadMode bit sets this field for packages matching the
// patterns; type information for dependencies may be missing or incomplete,
// unless NeedDeps and NeedImports are also set.
+ //
+ // Each call to [Load] returns a consistent set of type
+ // symbols, as defined by the comment at [types.Identical].
+ // Avoid mixing type information from two or more calls to [Load].
Types *types.Package
// Fset provides position information for Types, TypesInfo, and Syntax.