Commit f205ae33 authored by Robert Griesemer's avatar Robert Griesemer

go/importer: update documentation on ForCompiler lookup parameter

Change-Id: I80dff181a79858b52ba77c3f38f77a744b423afa
Reviewed-on: https://go-review.googlesource.com/c/go/+/184079Reviewed-by: default avatarMichael Matloob <matloob@golang.org>
parent f1a8ca30
...@@ -28,17 +28,15 @@ type Lookup func(path string) (io.ReadCloser, error) ...@@ -28,17 +28,15 @@ type Lookup func(path string) (io.ReadCloser, error)
// (if the package API depends on cgo-defined entities, the type // (if the package API depends on cgo-defined entities, the type
// checker won't have access to those). // checker won't have access to those).
// //
// If lookup is nil, the default package lookup mechanism for the // The lookup function is called each time the resulting importer needs
// given compiler is used, and the resulting importer attempts // to resolve an import path. In this mode the importer can only be
// to resolve relative and absolute import paths to canonical // invoked with canonical import paths (not relative or absolute ones);
// import path IDs before finding the imported file. // it is assumed that the translation to canonical import paths is being
// done by the client of the importer.
// //
// If lookup is non-nil, then the returned importer calls lookup // A lookup function must be provided for correct module-aware operation.
// each time it needs to resolve an import path. In this mode // Deprecated: If lookup is nil, for backwards-compatibility, the importer
// the importer can only be invoked with canonical import paths // will attempt to resolve imports in the $GOPATH workspace.
// (not relative or absolute ones); it is assumed that the translation
// to canonical import paths is being done by the client of the
// importer.
func ForCompiler(fset *token.FileSet, compiler string, lookup Lookup) types.Importer { func ForCompiler(fset *token.FileSet, compiler string, lookup Lookup) types.Importer {
switch compiler { switch compiler {
case "gc": case "gc":
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment