func (p *Package) Import(to string) (*types.Package, error) {
	if to == "unsafe" {
		return types.Unsafe, nil
	}
	if _, ok := p.Imports[to]; ok {
		return p.Imports[to].Pkg, nil
	} else {
		return nil, errors.New("package not imported: " + to)
	}
}
// Import implements types.Importer. It loads and parses packages it encounters
// along the way, if needed.
Import implements types.Importer. It loads and parses packages it encounters
along the way, if needed.
// Import implements types . Importer . It loads and parses packages it encounters // along the way if needed .
func (p *Package) Import(to string) (*types.Package, error) {
	if to == "unsafe" {
		return types.Unsafe, nil
	}
	if _, ok := p.Imports[to]; ok {
		return p.Imports[to].Pkg, nil
	} else {
		return nil, errors.New("package not imported: " + to)
	}
}
func ( p * Package ) Import ( to string ) ( * types . Package , error ) { if to == " " { return types . Unsafe , nil } if _ , ok := p . Imports [ to ] ; ok { return p . Imports [ to ] . Pkg , nil } else { return nil , errors . New ( " " + to ) } }
Import implements types.Importer.
Import implements types . Importer .