An importer resolves import paths to Packages. The imports map records packages already known, indexed by package path. The type-checker will invoke Import with Config.Packages. An importer must determine the canonical package path and check imports to see if it is already present in the map. If so, the Importer can return the map entry. Otherwise, the importer must load the package data for the given path into a new *Package, record it in imports map, and return the package. TODO(gri) Need to be clearer about requirements of completeness.
// If Import != nil, it is called for each imported package. // Otherwise, DefaultImport is called. Import Importer // If Sizes != nil, it provides the sizing functions for package unsafe.
// // in a client of go/types will initialize DefaultImport to gcimporter.Import. var DefaultImport Importer // Info holds result type information for a type-checked package.