go/loader: document cgo limitation

Change-Id: I8ce744d204fe2850d322b3095d04e8a399984983
Reviewed-on: https://go-review.googlesource.com/15391
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Alan Donovan 2015-10-05 10:55:06 -04:00
parent b7f0150d16
commit 9d2ff756b7
1 changed files with 9 additions and 0 deletions

View File

@ -123,6 +123,15 @@ type Program struct {
// filenames were supplied by Config.CreatePkgs[i], followed by
// the external test package, if any, of each package in
// Config.ImportPkgs ordered by ImportPath.
//
// NOTE: these files must not import "C". Cgo preprocessing is
// only performed on imported packages, not ad hoc packages.
//
// TODO(adonovan): we need to copy and adapt the logic of
// goFilesPackage (from $GOROOT/src/cmd/go/build.go) and make
// Config.Import and Config.Create methods return the same kind
// of entity, essentially a build.Package.
// Perhaps we can even reuse that type directly.
Created []*PackageInfo
// Imported contains the initially imported packages,