Documentation ¶
Overview ¶
Package monoimporter provides a monorepo-compatible types.Importer for Go packages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Importer ¶
type Importer struct {
// contains filtered or unexported fields
}
Importer implements a go/types.Importer for bazel-like monorepo build systems for Go packages.
While open source Go depends on GOPATH and GOROOT to find packages, bazel-like build systems such as blaze or buck rely on a monorepo-style package search instead of using GOPATH and standard library packages are found in a zipped archive instead of GOROOT.
func New ¶
func New(ctxt build.Context, ua *unmappedArchives, ma *mappedArchives, sa *stdlibArchives, stdlibZip *zip.Reader) *Importer
New returns a new monorepo importer.
func NewFromZips ¶
func NewFromZips(ctxt build.Context, unmappedArchs, mappedArchs, stdlibArchs, stdlibZips []string) (*Importer, error)
NewFromZips returns a new monorepo importer, using the build context to pick the desired standard library zip archive.
zips refers to zip file paths with Go standard library object files.
archives refers to directories in which to find compiled Go package object files.