Go: go/internal/gcimporter Index | Files

package gcimporter

import "go/internal/gcimporter"

Package gcimporter implements Import for gc-generated object files.


Package Files

bimport.go exportdata.go gcimporter.go

func BImportData Uses

func BImportData(fset *token.FileSet, imports map[string]*types.Package, data []byte, path string) (_ int, _ *types.Package, err error)

BImportData imports a package from the serialized package data and returns the number of bytes consumed and a reference to the package. If the export data version is not recognized or the format is otherwise compromised, an error is returned.

func FindExportData Uses

func FindExportData(r *bufio.Reader) (hdr string, err error)

FindExportData positions the reader r at the beginning of the export data section of an underlying GC-created object/archive file by reading from it. The reader must be positioned at the start of the file before calling this function. The hdr result is the string before the export data, either "$$" or "$$B".

func FindPkg Uses

func FindPkg(path, srcDir string) (filename, id string)

FindPkg returns the filename and unique package id for an import path based on package information provided by build.Import (using the build.Default build.Context). A relative srcDir is interpreted relative to the current working directory. If no file was found, an empty filename is returned.

func Import Uses

func Import(packages map[string]*types.Package, path, srcDir string) (pkg *types.Package, err error)

Import imports a gc-generated package given its import path and srcDir, adds the corresponding package object to the packages map, and returns the object. The packages map must contain all packages already imported.

Package gcimporter imports 17 packages (graph) and is imported by 2 packages. Updated 2017-06-01. Refresh now. Tools for package owners.