mirror of https://github.com/golang/go.git
parent
38a8d9df92
commit
7c9bc60f00
|
|
@ -664,6 +664,15 @@ func LoadPackage(ctx context.Context, opts PackageOpts, path, srcDir string, stk
|
|||
return p
|
||||
}
|
||||
|
||||
// loadImport scans the directory named by path, which must be an import path,
|
||||
// but possibly a local import path (an absolute file system path or one beginning
|
||||
// with ./ or ../). A local relative path is interpreted relative to srcDir.
|
||||
// It returns a *Package describing the package found in that directory.
|
||||
// loadImport does not set tool flags and should only be used by
|
||||
// this package, as part of a bigger load operation, and by GOPATH-based "go get".
|
||||
// The returned PackageError, if any, describes why parent is not allowed
|
||||
// to import the named package, with the error referring to importPos.
|
||||
// The PackageError can only be non-nil when parent is not nil.
|
||||
func loadImport(ctx context.Context, opts PackageOpts, pre *preload, path, srcDir string, parent *Package, stk *ImportStack, importPos []token.Position, mode int) (*Package, *PackageError) {
|
||||
ctx, span := trace.StartSpan(ctx, "modload.loadImport "+path)
|
||||
defer span.Done()
|
||||
|
|
|
|||
Loading…
Reference in New Issue