go/importer: un-deprecate importer.ForCompiler

The Deprecate comment seems intended to apply only to the lookup
parameter, not the function itself. This CL clarifies the intent.

Fixes #79139

Change-Id: I436207cd0e4fd0f5214a1767486e39a54635fd21
Reviewed-on: https://go-review.googlesource.com/c/go/+/773040
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
Alan Donovan 2026-05-01 11:09:38 -04:00 committed by Gopher Robot
parent 3f3387fab8
commit 816c1a79fb

View file

@ -41,9 +41,10 @@ type Lookup func(path string) (io.ReadCloser, error)
// it is assumed that the translation to canonical import paths is being
// done by the client of the importer.
//
// A lookup function must be provided for correct module-aware operation.
// Deprecated: If lookup is nil, for backwards-compatibility, the importer
// will attempt to resolve imports in the $GOPATH workspace.
// A lookup function must be provided for correct module-aware
// operation. Providing a nil value for lookup is deprecated but, for
// backwards-compatibility, the importer will in this case attempt to
// resolve imports in the $GOPATH workspace.
func ForCompiler(fset *token.FileSet, compiler string, lookup Lookup) types.Importer {
switch compiler {
case "gc":