From: Alan Donovan Date: Tue, 18 Oct 2022 12:25:51 +0000 (-0400) Subject: go/types: mention FakeImportC in Package.Import doc comment X-Git-Tag: go1.20rc1~195 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=fee0ab8b5ecab3c1170a80300c8c41f09486ca66;p=gostls13.git go/types: mention FakeImportC in Package.Import doc comment Change-Id: If4a82893f855d86de3311247424b1a3740c1f212 Reviewed-on: https://go-review.googlesource.com/c/go/+/443615 Reviewed-by: Robert Griesemer Run-TryBot: Alan Donovan TryBot-Result: Gopher Robot --- diff --git a/src/cmd/compile/internal/types2/package.go b/src/cmd/compile/internal/types2/package.go index 26f10645d2..61670f6718 100644 --- a/src/cmd/compile/internal/types2/package.go +++ b/src/cmd/compile/internal/types2/package.go @@ -59,6 +59,9 @@ func (pkg *Package) MarkComplete() { pkg.complete = true } // If pkg was loaded from export data, Imports includes packages that // provide package-level objects referenced by pkg. This may be more or // less than the set of packages directly imported by pkg's source code. +// +// If pkg uses cgo and the FakeImportC configuration option +// was enabled, the imports list may contain a fake "C" package. func (pkg *Package) Imports() []*Package { return pkg.imports } // SetImports sets the list of explicitly imported packages to list. diff --git a/src/go/types/package.go b/src/go/types/package.go index 26385dc39b..2b72ff1509 100644 --- a/src/go/types/package.go +++ b/src/go/types/package.go @@ -60,6 +60,9 @@ func (pkg *Package) MarkComplete() { pkg.complete = true } // If pkg was loaded from export data, Imports includes packages that // provide package-level objects referenced by pkg. This may be more or // less than the set of packages directly imported by pkg's source code. +// +// If pkg uses cgo and the FakeImportC configuration option +// was enabled, the imports list may contain a fake "C" package. func (pkg *Package) Imports() []*Package { return pkg.imports } // SetImports sets the list of explicitly imported packages to list.