packages

package
v1.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2024 License: Apache-2.0 Imports: 8 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindExport

func FindExport(dir, pkgPath string) (expfile string, err error)

FindExport lookups export file (.a) of a package by its pkgPath. It returns empty if pkgPath not found.

Types

type Importer

type Importer struct {
	// contains filtered or unexported fields
}

func NewImporter

func NewImporter(fset *token.FileSet, workDir ...string) *Importer

NewImporter creates an Importer object that meets types.Importer interface.

func (*Importer) Import

func (p *Importer) Import(pkgPath string) (pkg *types.Package, err error)

func (*Importer) ImportFrom

func (p *Importer) ImportFrom(pkgPath, dir string, mode types.ImportMode) (*types.Package, error)

ImportFrom returns the imported package for the given import path when imported by a package file located in dir. If the import failed, besides returning an error, ImportFrom is encouraged to cache and return a package anyway, if one was created. This will reduce package inconsistencies and follow-on type checker errors due to the missing package. The mode value must be 0; it is reserved for future use. Two calls to ImportFrom with the same path and dir must return the same package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL